aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ldo.c b/ldo.c
index d474c0a0..e9a88e9e 100644
--- a/ldo.c
+++ b/ldo.c
@@ -666,6 +666,8 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs,
666 if (L->status == LUA_OK) { /* may be starting a coroutine */ 666 if (L->status == LUA_OK) { /* may be starting a coroutine */
667 if (L->ci != &L->base_ci) /* not in base level? */ 667 if (L->ci != &L->base_ci) /* not in base level? */
668 return resume_error(L, "cannot resume non-suspended coroutine", nargs); 668 return resume_error(L, "cannot resume non-suspended coroutine", nargs);
669 else if (L->top - (L->ci->func + 1) == nargs) /* no function? */
670 return resume_error(L, "cannot resume dead coroutine", nargs);
669 } 671 }
670 else if (L->status != LUA_YIELD) 672 else if (L->status != LUA_YIELD)
671 return resume_error(L, "cannot resume dead coroutine", nargs); 673 return resume_error(L, "cannot resume dead coroutine", nargs);