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

Function luaD_throw

third-party/lua-5.4.6/src/ldo.c:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111l_noret luaD_throw (lua_State *L, int errcode) {
112 if (L->errorJmp) { /* thread has an error handler? */
113 L->errorJmp->status = errcode; /* set status */
114 LUAI_THROW(L, L->errorJmp); /* jump to it */
115 }
116 else { /* thread has no error handler */
117 global_State *g = G(L);
118 errcode = luaE_resetthread(L, errcode); /* close all upvalues */
119 L->status = errcode;
120 if (g->mainthread->errorJmp) { /* main thread has a handler? */
121 setobjs2s(L, g->mainthread->top.p++, L->top.p - 1); /* copy error obj. */
122 luaD_throw(g->mainthread, errcode); /* re-throw in main thread */
123 }
124 else { /* no handler at all; abort */
125 if (g->panic) { /* panic function? */
126 lua_unlock(L);
127 g->panic(L); /* call panic function (last chance to jump out) */
128 }
129 abort();
130 }
131 }
132}
133
134
135int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {

Callers 7

lexerrorFunction · 0.70
errorFunction · 0.70
luaG_errormsgFunction · 0.70
luaG_traceexecFunction · 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