Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {


l_noret luaD_throw (lua_State *L, int errcode) {
if (L->errorJmp) { /* thread has an error handler? */
if { /* no handler at all; abort */
if (g->panic) { /* panic function? */
lua_unlock(L);
g->panic(L); /* call panic function (last chance to jump out) */
}
abort();
}
else if (L->errorJmp) { /* thread has an error handler? */
L->errorJmp->status = errcode; /* set status */
LUAI_THROW(L, L->errorJmp); /* jump to it */
}
Expand All @@ -124,13 +131,6 @@ l_noret luaD_throw (lua_State *L, int errcode) {
setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */
luaD_throw(g->mainthread, errcode); /* re-throw in main thread */
}
else { /* no handler at all; abort */
if (g->panic) { /* panic function? */
lua_unlock(L);
g->panic(L); /* call panic function (last chance to jump out) */
}
abort();
}
}
}

Expand Down