Browse Source

Leave hook when resume catches error thrown from hook.

Mike Pall 12 years ago
parent
commit
e422ae2d9d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/lj_err.c

+ 1 - 0
src/lj_err.c

@@ -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;
 	}