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

Function luaD_seterrorobj

third-party/lua-5.5.0/src/ldo.c:112–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112void luaD_seterrorobj (lua_State *L, TStatus errcode, StkId oldtop) {
113 if (errcode == LUA_ERRMEM) { /* memory error? */
114 setsvalue2s(L, oldtop, G(L)->memerrmsg); /* reuse preregistered msg. */
115 }
116 else {
117 lua_assert(errorstatus(errcode)); /* must be a real error */
118 lua_assert(!ttisnil(s2v(L->top.p - 1))); /* with a non-nil object */
119 setobjs2s(L, oldtop, L->top.p - 1); /* move it to 'oldtop' */
120 }
121 L->top.p = oldtop + 1; /* top goes back to old top plus error object */
122}
123
124
125l_noret luaD_throw (lua_State *L, TStatus errcode) {

Callers 5

luaE_resetthreadFunction · 0.70
prepcallclosemthFunction · 0.70
finishpcallkFunction · 0.70
lua_resumeFunction · 0.70
luaD_pcallFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected