diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.127 2014/08/01 17:33:08 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.128 2014/10/07 18:29:13 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -111,15 +111,16 @@ l_noret luaD_throw (lua_State *L, int errcode) { | |||
111 | LUAI_THROW(L, L->errorJmp); /* jump to it */ | 111 | LUAI_THROW(L, L->errorJmp); /* jump to it */ |
112 | } | 112 | } |
113 | else { /* thread has no error handler */ | 113 | else { /* thread has no error handler */ |
114 | global_State *g = G(L); | ||
114 | L->status = cast_byte(errcode); /* mark it as dead */ | 115 | L->status = cast_byte(errcode); /* mark it as dead */ |
115 | if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */ | 116 | if (g->mainthread->errorJmp) { /* main thread has a handler? */ |
116 | setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */ | 117 | setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ |
117 | luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */ | 118 | luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ |
118 | } | 119 | } |
119 | else { /* no handler at all; abort */ | 120 | else { /* no handler at all; abort */ |
120 | if (G(L)->panic) { /* panic function? */ | 121 | if (g->panic) { /* panic function? */ |
121 | lua_unlock(L); | 122 | lua_unlock(L); |
122 | G(L)->panic(L); /* call it (last chance to jump out) */ | 123 | g->panic(L); /* call it (last chance to jump out) */ |
123 | } | 124 | } |
124 | abort(); | 125 | abort(); |
125 | } | 126 | } |