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

Function luaD_pcall

third-party/lua-5.5.0/src/ldo.c:1081–1098  ·  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

1079** its stack level in case of errors.
1080*/
1081TStatus luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t old_top,
1082 ptrdiff_t ef) {
1083 TStatus status;
1084 CallInfo *old_ci = L->ci;
1085 lu_byte old_allowhooks = L->allowhook;
1086 ptrdiff_t old_errfunc = L->errfunc;
1087 L->errfunc = ef;
1088 status = luaD_rawrunprotected(L, func, u);
1089 if (l_unlikely(status != LUA_OK)) { /* an error occurred? */
1090 L->ci = old_ci;
1091 L->allowhook = old_allowhooks;
1092 status = luaD_closeprotected(L, old_top, status);
1093 luaD_seterrorobj(L, status, restorestack(L, old_top));
1094 luaD_shrinkstack(L); /* restore stack size in case of overflow */
1095 }
1096 L->errfunc = old_errfunc;
1097 return status;
1098}
1099
1100
1101

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