MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaD_throw

Function luaD_throw

lib/lua/src/ldo.c:115–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 8

lexerrorFunction · 0.85
luaE_checkcstackFunction · 0.85
errorFunction · 0.85
luaG_errormsgFunction · 0.85
luaG_traceexecFunction · 0.85
luaD_growstackFunction · 0.85
lua_yieldkFunction · 0.85
checkmodeFunction · 0.85

Calls 2

luaE_resetthreadFunction · 0.85
GFunction · 0.50

Tested by

no test coverage detected