From 64d5df77721da0183360d50da8d68663526bfa6a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 10 Dec 2009 16:17:37 -0200 Subject: [PATCH] detail (lua_resume should empty coroutine stack even if they do not fit into caller stack) --- lbaselib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbaselib.c b/lbaselib.c index bbc4cec5..15bab389 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.228 2009/11/26 11:39:20 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.229 2009/11/27 15:38:51 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -568,6 +568,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { if (status == LUA_OK || status == LUA_YIELD) { int nres = lua_gettop(co); if (!lua_checkstack(L, nres + 1)) { + lua_pop(co, nres); /* remove results anyway */ lua_pushliteral(L, "too many results to resume"); return -1; /* error flag */ }