Browse Source

Gracefully handle lua_error() for a suspended coroutine.

Thanks to Sergei Zhirikov.
Mike Pall 10 năm trước cách đây
mục cha
commit
c6e69249dd
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      src/lj_err.c

+ 1 - 2
src/lj_err.c

@@ -499,8 +499,7 @@ static ptrdiff_t finderrfunc(lua_State *L)
 {
   cTValue *frame = L->base-1, *bot = tvref(L->stack);
   void *cf = L->cframe;
-  while (frame > bot) {
-    lua_assert(cf != NULL);
+  while (frame > bot && cf) {
     while (cframe_nres(cframe_raw(cf)) < 0) {  /* cframe without frame? */
       if (frame >= restorestack(L, -cframe_nres(cf)))
 	break;