| 101 | |
| 102 | |
| 103 | l_noret luaD_throw (lua_State *L, int errcode) { |
| 104 | if (L->errorJmp) { /* thread has an error handler? */ |
| 105 | L->errorJmp->status = errcode; /* set status */ |
| 106 | LUAI_THROW(L, L->errorJmp); /* jump to it */ |
| 107 | } |
| 108 | else { /* thread has no error handler */ |
| 109 | L->status = cast_byte(errcode); /* mark it as dead */ |
| 110 | if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */ |
| 111 | setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */ |
| 112 | luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */ |
| 113 | } |
| 114 | else { /* no handler at all; abort */ |
| 115 | if (G(L)->panic) { /* panic function? */ |
| 116 | lua_unlock(L); |
| 117 | G(L)->panic(L); /* call it (last chance to jump out) */ |
| 118 | } |
| 119 | abort(); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | |
| 125 | int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { |
no outgoing calls
no test coverage detected