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

Function luaD_throw

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

Source from the content-addressed store, hash-verified

123
124
125l_noret luaD_throw (lua_State *L, TStatus errcode) {
126 if (L->errorJmp) { /* thread has an error handler? */
127 L->errorJmp->status = errcode; /* set status */
128 LUAI_THROW(L, L->errorJmp); /* jump to it */
129 }
130 else { /* thread has no error handler */
131 global_State *g = G(L);
132 lua_State *mainth = mainthread(g);
133 errcode = luaE_resetthread(L, errcode); /* close all upvalues */
134 L->status = errcode;
135 if (mainth->errorJmp) { /* main thread has a handler? */
136 setobjs2s(L, mainth->top.p++, L->top.p - 1); /* copy error obj. */
137 luaD_throw(mainth, errcode); /* re-throw in main thread */
138 }
139 else { /* no handler at all; abort */
140 if (g->panic) { /* panic function? */
141 lua_unlock(L);
142 g->panic(L); /* call panic function (last chance to jump out) */
143 }
144 abort();
145 }
146 }
147}
148
149
150l_noret luaD_throwbaselevel (lua_State *L, TStatus errcode) {

Callers 10

lexerrorFunction · 0.70
pushbuffFunction · 0.70
luaO_pushfstringFunction · 0.70
errorFunction · 0.70
luaG_errormsgFunction · 0.70
luaG_traceexecFunction · 0.70
luaD_throwbaselevelFunction · 0.70
luaD_errerrFunction · 0.70
lua_yieldkFunction · 0.70
checkmodeFunction · 0.70

Calls 1

luaE_resetthreadFunction · 0.70

Tested by

no test coverage detected