mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Leave hook when resume catches error thrown from hook.
This commit is contained in:
parent
41738e371a
commit
e422ae2d9d
@ -136,6 +136,7 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode)
|
|||||||
case FRAME_CP: /* Protected C frame. */
|
case FRAME_CP: /* Protected C frame. */
|
||||||
if (cframe_canyield(cf)) { /* Resume? */
|
if (cframe_canyield(cf)) { /* Resume? */
|
||||||
if (errcode) {
|
if (errcode) {
|
||||||
|
hook_leave(G(L)); /* Assumes nobody uses coroutines inside hooks. */
|
||||||
L->cframe = NULL;
|
L->cframe = NULL;
|
||||||
L->status = (uint8_t)errcode;
|
L->status = (uint8_t)errcode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user