|
|
|
@ -104,10 +104,12 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {
|
|
|
|
|
setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling"));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#ifdef RAVI_DEFER_STATEMENT
|
|
|
|
|
case CLOSEPROTECT: {
|
|
|
|
|
setnilvalue(oldtop); /* no error message */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
default: {
|
|
|
|
|
setobjs2s(L, oldtop, L->top - 1); /* error message on current top */
|
|
|
|
|
break;
|
|
|
|
@ -124,7 +126,9 @@ l_noret luaD_throw (lua_State *L, int errcode) {
|
|
|
|
|
}
|
|
|
|
|
else { /* thread has no error handler */
|
|
|
|
|
global_State *g = G(L);
|
|
|
|
|
#ifdef RAVI_DEFER_STATEMENT
|
|
|
|
|
errcode = luaF_close(L, L->stack, errcode); /* close all upvalues */
|
|
|
|
|
#endif
|
|
|
|
|
L->status = cast_byte(errcode); /* mark it as dead */
|
|
|
|
|
if (g->mainthread->errorJmp) { /* main thread has a handler? */
|
|
|
|
|
setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */
|
|
|
|
|