mirror of https://github.com/rusefi/lua.git
bug: auxresume should reserve stack space for boolean result
This commit is contained in:
parent
163f58dac5
commit
015e973899
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lbaselib.c,v 1.201 2007/11/28 18:25:17 roberto Exp roberto $
|
** $Id: lbaselib.c,v 1.202 2008/01/03 17:07:59 roberto Exp roberto $
|
||||||
** Basic library
|
** Basic library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -483,7 +483,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
|
||||||
status = lua_resume(co, narg);
|
status = lua_resume(co, narg);
|
||||||
if (status == LUA_OK || status == LUA_YIELD) {
|
if (status == LUA_OK || status == LUA_YIELD) {
|
||||||
int nres = lua_gettop(co);
|
int nres = lua_gettop(co);
|
||||||
if (!lua_checkstack(L, nres))
|
if (!lua_checkstack(L, nres + 1))
|
||||||
return luaL_error(L, "too many results to resume");
|
return luaL_error(L, "too many results to resume");
|
||||||
lua_xmove(co, L, nres); /* move yielded values */
|
lua_xmove(co, L, nres); /* move yielded values */
|
||||||
return nres;
|
return nres;
|
||||||
|
|
Loading…
Reference in New Issue