lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 75f73172c463af9643bc187eed7f1fd195238078
parent 754c6307544f751d870c7b6636196e4405cab0b6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri, 20 Dec 2002 07:55:34 -0200

bug: `resume' was checking the wrong value for stack overflow

Diffstat:
Mbugs | 10++++++++++
Mlbaselib.c | 4++--
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/bugs b/bugs @@ -303,3 +303,13 @@ Fri Dec 6 17:06:40 UTC 2002 >> scope of generic for variables is not sound (by Gavin Wraith; since 5.0a) + + + +================================================================= +--- Version 5.0 beta +** lbaselib.c +Fri Dec 20 09:53:19 UTC 2002 +>> `resume' was checking the wrong value for stack overflow +(by Maik Zimmermann; since 5.0b) + diff --git a/lbaselib.c b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.114 2002/12/04 17:38:31 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.115 2002/12/06 17:05:15 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -540,7 +540,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { status = lua_resume(co, narg); if (status == 0) { int nres = lua_gettop(co); - if (!lua_checkstack(L, narg)) + if (!lua_checkstack(L, nres)) luaL_error(L, "too many results to resume"); lua_xmove(co, L, nres); /* move yielded values */ return nres;