MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaD_pcall

Function luaD_pcall

third-party/lua-5.4.6/src/ldo.c:957–974  ·  view source on GitHub ↗

** Call the C function 'func' in protected mode, restoring basic ** thread information ('allowhook', etc.) and in particular ** its stack level in case of errors. */

Source from the content-addressed store, hash-verified

955** its stack level in case of errors.
956*/
957int luaD_pcall (lua_State *L, Pfunc func, void *u,
958 ptrdiff_t old_top, ptrdiff_t ef) {
959 int status;
960 CallInfo *old_ci = L->ci;
961 lu_byte old_allowhooks = L->allowhook;
962 ptrdiff_t old_errfunc = L->errfunc;
963 L->errfunc = ef;
964 status = luaD_rawrunprotected(L, func, u);
965 if (l_unlikely(status != LUA_OK)) { /* an error occurred? */
966 L->ci = old_ci;
967 L->allowhook = old_allowhooks;
968 status = luaD_closeprotected(L, old_top, status);
969 luaD_seterrorobj(L, status, restorestack(L, old_top));
970 luaD_shrinkstack(L); /* restore stack size in case of overflow */
971 }
972 L->errfunc = old_errfunc;
973 return status;
974}
975
976
977

Callers 3

luaD_protectedparserFunction · 0.70
lua_pcallkFunction · 0.70
GCTMFunction · 0.70

Calls 4

luaD_rawrunprotectedFunction · 0.70
luaD_closeprotectedFunction · 0.70
luaD_seterrorobjFunction · 0.70
luaD_shrinkstackFunction · 0.70

Tested by

no test coverage detected