mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix argument checks for coroutine.create().
This commit is contained in:
parent
10b9ed37e0
commit
97b7edb206
@ -550,9 +550,10 @@ LJLIB_CF(coroutine_running)
|
|||||||
|
|
||||||
LJLIB_CF(coroutine_create)
|
LJLIB_CF(coroutine_create)
|
||||||
{
|
{
|
||||||
lua_State *L1 = lua_newthread(L);
|
lua_State *L1;
|
||||||
if (!(L->base < L->top && tvisfunc(L->base)))
|
if (!(L->base < L->top && tvisfunc(L->base)))
|
||||||
lj_err_argt(L, 1, LUA_TFUNCTION);
|
lj_err_argt(L, 1, LUA_TFUNCTION);
|
||||||
|
L1 = lua_newthread(L);
|
||||||
setfuncV(L, L1->top++, funcV(L->base));
|
setfuncV(L, L1->top++, funcV(L->base));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user