mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
detail (lua_resume should empty coroutine stack even if they do not
fit into caller stack)
This commit is contained in:
parent
2643da67c6
commit
64d5df7772
@ -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
|
** Basic library
|
||||||
** See Copyright Notice in lua.h
|
** 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) {
|
if (status == LUA_OK || status == LUA_YIELD) {
|
||||||
int nres = lua_gettop(co);
|
int nres = lua_gettop(co);
|
||||||
if (!lua_checkstack(L, nres + 1)) {
|
if (!lua_checkstack(L, nres + 1)) {
|
||||||
|
lua_pop(co, nres); /* remove results anyway */
|
||||||
lua_pushliteral(L, "too many results to resume");
|
lua_pushliteral(L, "too many results to resume");
|
||||||
return -1; /* error flag */
|
return -1; /* error flag */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user