| 593 | |
| 594 | |
| 595 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 596 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 597 | int status; |
| 598 | CallInfo *old_ci = L->ci; |
| 599 | lu_byte old_allowhooks = L->allowhook; |
| 600 | unsigned short old_nny = L->nny; |
| 601 | ptrdiff_t old_errfunc = L->errfunc; |
| 602 | L->errfunc = ef; |
| 603 | status = luaD_rawrunprotected(L, func, u); |
| 604 | if (status != LUA_OK) { /* an error occurred? */ |
| 605 | StkId oldtop = restorestack(L, old_top); |
| 606 | luaF_close(L, oldtop); /* close possible pending closures */ |
| 607 | seterrorobj(L, status, oldtop); |
| 608 | L->ci = old_ci; |
| 609 | L->allowhook = old_allowhooks; |
| 610 | L->nny = old_nny; |
| 611 | luaD_shrinkstack(L); |
| 612 | } |
| 613 | L->errfunc = old_errfunc; |
| 614 | return status; |
| 615 | } |
| 616 | |
| 617 | |
| 618 |
no test coverage detected