diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-10 16:17:37 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-10 16:17:37 -0200 |
commit | 64d5df77721da0183360d50da8d68663526bfa6a (patch) | |
tree | bcca016056f219246c7542c5b87254446d6c1395 /lbaselib.c | |
parent | 2643da67c686bac5e29fdf94f54a06e33eb08dd0 (diff) | |
download | lua-64d5df77721da0183360d50da8d68663526bfa6a.tar.gz lua-64d5df77721da0183360d50da8d68663526bfa6a.tar.bz2 lua-64d5df77721da0183360d50da8d68663526bfa6a.zip |
detail (lua_resume should empty coroutine stack even if they do not
fit into caller stack)
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.228 2009/11/26 11:39:20 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.229 2009/11/27 15:38:51 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 | */ |
@@ -568,6 +568,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { | |||
568 | if (status == LUA_OK || status == LUA_YIELD) { | 568 | if (status == LUA_OK || status == LUA_YIELD) { |
569 | int nres = lua_gettop(co); | 569 | int nres = lua_gettop(co); |
570 | if (!lua_checkstack(L, nres + 1)) { | 570 | if (!lua_checkstack(L, nres + 1)) { |
571 | lua_pop(co, nres); /* remove results anyway */ | ||
571 | lua_pushliteral(L, "too many results to resume"); | 572 | lua_pushliteral(L, "too many results to resume"); |
572 | return -1; /* error flag */ | 573 | return -1; /* error flag */ |
573 | } | 574 | } |