MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaD_pcall

Function luaD_pcall

depends/lua/src/ldo.c:721–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719
720
721int luaD_pcall (lua_State *L, Pfunc func, void *u,
722 ptrdiff_t old_top, ptrdiff_t ef) {
723 int status;
724 CallInfo *old_ci = L->ci;
725 lu_byte old_allowhooks = L->allowhook;
726 unsigned short old_nny = L->nny;
727 ptrdiff_t old_errfunc = L->errfunc;
728 L->errfunc = ef;
729 status = luaD_rawrunprotected(L, func, u);
730 if (status != LUA_OK) { /* an error occurred? */
731 StkId oldtop = restorestack(L, old_top);
732 luaF_close(L, oldtop); /* close possible pending closures */
733 seterrorobj(L, status, oldtop);
734 L->ci = old_ci;
735 L->allowhook = old_allowhooks;
736 L->nny = old_nny;
737 luaD_shrinkstack(L);
738 }
739 L->errfunc = old_errfunc;
740 return status;
741}
742
743
744

Callers 3

luaD_protectedparserFunction · 0.85
lua_pcallkFunction · 0.85
GCTMFunction · 0.85

Calls 4

luaD_rawrunprotectedFunction · 0.85
luaF_closeFunction · 0.85
seterrorobjFunction · 0.85
luaD_shrinkstackFunction · 0.85

Tested by

no test coverage detected