From c6e69249ddc69523eaa0c88f68c6f816a30b537c Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 15 Dec 2014 01:55:45 +0100 Subject: [PATCH] Gracefully handle lua_error() for a suspended coroutine. Thanks to Sergei Zhirikov. --- src/lj_err.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lj_err.c b/src/lj_err.c index 3097795c..8010221f 100644 --- a/src/lj_err.c +++ b/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;