diff -up lua-5.4.0/src/ldo.c.bug2 lua-5.4.0/src/ldo.c --- lua-5.4.0/src/ldo.c.bug2 2020-07-31 10:40:55.409594540 -0400 +++ lua-5.4.0/src/ldo.c 2020-07-31 10:41:19.193556341 -0400 @@ -674,7 +674,7 @@ LUA_API int lua_resume (lua_State *L, lu if (from == NULL) L->nCcalls = CSTACKTHREAD; else /* correct 'nCcalls' for this thread */ - L->nCcalls = getCcalls(from) + from->nci - L->nci - CSTACKCF; + L->nCcalls = getCcalls(from) - L->nci - CSTACKCF; if (L->nCcalls <= CSTACKERR) return resume_error(L, "C stack overflow", nargs); luai_userstateresume(L, nargs);