Fix argument checks for coroutine.create().

master
Mike Pall 2012-05-28 21:38:23 +02:00
parent 10b9ed37e0
commit 97b7edb206
1 changed files with 2 additions and 1 deletions

View File

@ -550,9 +550,10 @@ LJLIB_CF(coroutine_running)
LJLIB_CF(coroutine_create)
{
lua_State *L1 = lua_newthread(L);
lua_State *L1;
if (!(L->base < L->top && tvisfunc(L->base)))
lj_err_argt(L, 1, LUA_TFUNCTION);
L1 = lua_newthread(L);
setfuncV(L, L1->top++, funcV(L->base));
return 1;
}