aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib_base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib_base.c b/src/lib_base.c
index 927c1bca..149aa5cf 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -550,9 +550,10 @@ LJLIB_CF(coroutine_running)
550 550
551LJLIB_CF(coroutine_create) 551LJLIB_CF(coroutine_create)
552{ 552{
553 lua_State *L1 = lua_newthread(L); 553 lua_State *L1;
554 if (!(L->base < L->top && tvisfunc(L->base))) 554 if (!(L->base < L->top && tvisfunc(L->base)))
555 lj_err_argt(L, 1, LUA_TFUNCTION); 555 lj_err_argt(L, 1, LUA_TFUNCTION);
556 L1 = lua_newthread(L);
556 setfuncV(L, L1->top++, funcV(L->base)); 557 setfuncV(L, L1->top++, funcV(L->base));
557 return 1; 558 return 1;
558} 559}