MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaD_throw

Function luaD_throw

freebsd/contrib/openzfs/module/lua/ldo.c:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171
172l_noret luaD_throw (lua_State *L, int errcode) {
173 if (L->errorJmp) { /* thread has an error handler? */
174 L->errorJmp->status = errcode; /* set status */
175 LUAI_THROW(L, L->errorJmp); /* jump to it */
176 }
177 else { /* thread has no error handler */
178 L->status = cast_byte(errcode); /* mark it as dead */
179 if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */
180 setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */
181 luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */
182 }
183 else { /* no handler at all; abort */
184 if (G(L)->panic) { /* panic function? */
185 lua_unlock(L);
186 G(L)->panic(L); /* call it (last chance to jump out) */
187 }
188 panic("no error handler");
189 }
190 }
191}
192
193
194int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {

Callers 10

traceexecFunction · 0.70
luaM_realloc_Function · 0.70
lexerrorFunction · 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 1

panicFunction · 0.50

Tested by

no test coverage detected