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

Function luaB_xpcall

third-party/lua-5.5.0/src/lbaselib.c:497–506  ·  view source on GitHub ↗

** Do a protected call with error handling. After 'lua_rotate', the ** stack will have ; so, the function passes ** 2 to 'finishpcall' to skip the 2 first values when returning results. */

Source from the content-addressed store, hash-verified

495** 2 to 'finishpcall' to skip the 2 first values when returning results.
496*/
497static int luaB_xpcall (lua_State *L) {
498 int status;
499 int n = lua_gettop(L);
500 luaL_checktype(L, 2, LUA_TFUNCTION); /* check error function */
501 lua_pushboolean(L, 1); /* first result */
502 lua_pushvalue(L, 1); /* function */
503 lua_rotate(L, 3, 2); /* move them below function's arguments */
504 status = lua_pcallk(L, n - 2, LUA_MULTRET, 2, 2, finishpcall);
505 return finishpcall(L, status, 2);
506}
507
508
509static int luaB_tostring (lua_State *L) {

Callers

nothing calls this directly

Calls 7

lua_gettopFunction · 0.70
luaL_checktypeFunction · 0.70
lua_pushbooleanFunction · 0.70
lua_pushvalueFunction · 0.70
lua_rotateFunction · 0.70
lua_pcallkFunction · 0.70
finishpcallFunction · 0.70

Tested by

no test coverage detected