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

Function do_finish_pcall

library/LuaTools.cpp:776–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

774}
775
776static bool do_finish_pcall(lua_State *L, bool success, int base = 1, int space = 2)
777{
778 if (!lua_checkstack(L, space))
779 {
780 lua_settop(L, base-1); /* create space for return values */
781 lua_pushboolean(L, 0);
782 push_simple_error(L, "stack overflow");
783 return false;
784 }
785 else
786 {
787 lua_pushboolean(L, success);
788 lua_replace(L, base); /* put first result in first slot */
789 return success;
790 }
791}
792
793namespace {
794 int safecall_cont(lua_State *L, int status, lua_KContext)

Callers 1

safecall_contFunction · 0.85

Calls 4

lua_checkstackFunction · 0.85
lua_settopFunction · 0.85
lua_pushbooleanFunction · 0.85
push_simple_errorFunction · 0.85

Tested by

no test coverage detected