Leave hook when resume catches error thrown from hook.

This commit is contained in:
Mike Pall 2012-12-06 14:14:11 +01:00
parent 41738e371a
commit e422ae2d9d

View File

@ -136,6 +136,7 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode)
case FRAME_CP: /* Protected C frame. */
if (cframe_canyield(cf)) { /* Resume? */
if (errcode) {
hook_leave(G(L)); /* Assumes nobody uses coroutines inside hooks. */
L->cframe = NULL;
L->status = (uint8_t)errcode;
}