diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-07-15 14:35:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-07-15 14:35:20 -0300 |
commit | 5bff2aaf473e06b884846125ea6f5a718e2177bc (patch) | |
tree | 656d2f7724ea1ee36f7b6182680704d2cb5b10b0 /lua.c | |
parent | f76f4cb79d84af4a7be9e0d75553bbe05a3ae90c (diff) | |
download | lua-5bff2aaf473e06b884846125ea6f5a718e2177bc.tar.gz lua-5bff2aaf473e06b884846125ea6f5a718e2177bc.tar.bz2 lua-5bff2aaf473e06b884846125ea6f5a718e2177bc.zip |
calls with LUA_MULTRET may leave no free slots in the stack
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.172 2009/02/19 17:15:35 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.173 2009/06/18 18:59:58 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -218,6 +218,7 @@ static void dotty (lua_State *L) { | |||
218 | if (status == LUA_OK) status = docall(L, 0, 0); | 218 | if (status == LUA_OK) status = docall(L, 0, 0); |
219 | report(L, status); | 219 | report(L, status); |
220 | if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ | 220 | if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ |
221 | luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); | ||
221 | lua_getglobal(L, "print"); | 222 | lua_getglobal(L, "print"); |
222 | lua_insert(L, 1); | 223 | lua_insert(L, 1); |
223 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) | 224 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) |