diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-11 17:14:52 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-11 17:14:52 -0200 |
commit | 015e97389931edf2c399fbd91e890abd048118dd (patch) | |
tree | 6c96f2f959484bae2ae63a7233d1bd92630b797b | |
parent | 163f58dac53330b8ace2421d838b5cf399bc4bf9 (diff) | |
download | lua-015e97389931edf2c399fbd91e890abd048118dd.tar.gz lua-015e97389931edf2c399fbd91e890abd048118dd.tar.bz2 lua-015e97389931edf2c399fbd91e890abd048118dd.zip |
bug: auxresume should reserve stack space for boolean result
-rw-r--r-- | lbaselib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.201 2007/11/28 18:25:17 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.202 2008/01/03 17:07:59 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -483,7 +483,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { | |||
483 | status = lua_resume(co, narg); | 483 | status = lua_resume(co, narg); |
484 | if (status == LUA_OK || status == LUA_YIELD) { | 484 | if (status == LUA_OK || status == LUA_YIELD) { |
485 | int nres = lua_gettop(co); | 485 | int nres = lua_gettop(co); |
486 | if (!lua_checkstack(L, nres)) | 486 | if (!lua_checkstack(L, nres + 1)) |
487 | return luaL_error(L, "too many results to resume"); | 487 | return luaL_error(L, "too many results to resume"); |
488 | lua_xmove(co, L, nres); /* move yielded values */ | 488 | lua_xmove(co, L, nres); /* move yielded values */ |
489 | return nres; | 489 | return nres; |