From: Mike Pall Date: Mon, 28 May 2012 19:38:23 +0000 (+0200) Subject: Fix argument checks for coroutine.create(). X-Git-Tag: v2.0.0-beta11~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97b7edb206830d661e1eab30b40bffed93e9569e;p=thirdparty%2FLuaJIT.git Fix argument checks for coroutine.create(). --- 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) 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; }