| 748 | |
| 749 | |
| 750 | int luaD_pcall(lua_State *L, Pfunc func, void *u, |
| 751 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 752 | int status; |
| 753 | CallInfo *old_ci = L->ci; |
| 754 | lu_byte old_allowhooks = L->allowhook; |
| 755 | unsigned short old_nny = L->nny; |
| 756 | ptrdiff_t old_errfunc = L->errfunc; |
| 757 | L->errfunc = ef; |
| 758 | status = luaD_rawrunprotected(L, func, u); |
| 759 | if (L->force_stopping) |
| 760 | status = LUA_ERRRUN; |
| 761 | if (status != LUA_OK) { /* an error occurred? */ |
| 762 | StkId oldtop = restorestack(L, old_top); |
| 763 | luaF_close(L, oldtop); /* close possible pending closures */ |
| 764 | seterrorobj(L, status, oldtop); |
| 765 | L->ci = old_ci; |
| 766 | L->allowhook = old_allowhooks; |
| 767 | L->nny = old_nny; |
| 768 | luaD_shrinkstack(L); |
| 769 | } |
| 770 | L->errfunc = old_errfunc; |
| 771 | return status; |
| 772 | } |
| 773 | |
| 774 | |
| 775 |
no test coverage detected