From 5bff2aaf473e06b884846125ea6f5a718e2177bc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 15 Jul 2009 14:35:20 -0300 Subject: calls with LUA_MULTRET may leave no free slots in the stack --- lua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua.c') diff --git a/lua.c b/lua.c index 2c456cc1..1885364f 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.172 2009/02/19 17:15:35 roberto Exp roberto $ +** $Id: lua.c,v 1.173 2009/06/18 18:59:58 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -218,6 +218,7 @@ static void dotty (lua_State *L) { if (status == LUA_OK) status = docall(L, 0, 0); report(L, status); if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ + luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); lua_getglobal(L, "print"); lua_insert(L, 1); if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) -- cgit v1.2.3-55-g6feb