MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaD_pcall

Function luaD_pcall

Source/Misc/lua/src/lua.c:5601–5623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

lua_pcallFunction · 0.85
lua_cpcallFunction · 0.85
luaD_protectedparserFunction · 0.85

Calls 4

luaD_rawrunprotectedFunction · 0.85
luaF_closeFunction · 0.85
luaD_seterrorobjFunction · 0.85
restore_stack_limitFunction · 0.85

Tested by

no test coverage detected