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

Function luaD_throw

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

Source from the content-addressed store, hash-verified

101
102
103l_noret luaD_throw (lua_State *L, int errcode) {
104 if (L->errorJmp) { /* thread has an error handler? */
105 L->errorJmp->status = errcode; /* set status */
106 LUAI_THROW(L, L->errorJmp); /* jump to it */
107 }
108 else { /* thread has no error handler */
109 L->status = cast_byte(errcode); /* mark it as dead */
110 if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */
111 setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */
112 luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */
113 }
114 else { /* no handler at all; abort */
115 if (G(L)->panic) { /* panic function? */
116 lua_unlock(L);
117 G(L)->panic(L); /* call it (last chance to jump out) */
118 }
119 abort();
120 }
121 }
122}
123
124
125int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {

Callers 11

traceexecFunction · 0.70
luaM_realloc_Function · 0.70
lexerrorFunction · 0.70
errorFunction · 0.70
luaG_errormsgFunction · 0.70
luaD_growstackFunction · 0.70
luaD_callFunction · 0.70
resume_errorFunction · 0.70
lua_yieldkFunction · 0.70
checkmodeFunction · 0.70
GCTMFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected