| 5599 | |
| 5600 | |
| 5601 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 5602 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 5603 | int status; |
| 5604 | unsigned short oldnCcalls = L->nCcalls; |
| 5605 | ptrdiff_t old_ci = saveci(L, L->ci); |
| 5606 | lu_byte old_allowhooks = L->allowhook; |
| 5607 | ptrdiff_t old_errfunc = L->errfunc; |
| 5608 | L->errfunc = ef; |
| 5609 | status = luaD_rawrunprotected(L, func, u); |
| 5610 | if (status != 0) { /* an error occurred? */ |
| 5611 | StkId oldtop = restorestack(L, old_top); |
| 5612 | luaF_close(L, oldtop); /* close eventual pending closures */ |
| 5613 | luaD_seterrorobj(L, status, oldtop); |
| 5614 | L->nCcalls = oldnCcalls; |
| 5615 | L->ci = restoreci(L, old_ci); |
| 5616 | L->base = L->ci->base; |
| 5617 | L->savedpc = L->ci->savedpc; |
| 5618 | L->allowhook = old_allowhooks; |
| 5619 | restore_stack_limit(L); |
| 5620 | } |
| 5621 | L->errfunc = old_errfunc; |
| 5622 | return status; |
| 5623 | } |
| 5624 | |
| 5625 | |
| 5626 |
no test coverage detected