lua

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

commit 85bda9eef51e69384fe23114feaeeedfb6bb5f8c
parent a4d3080fe3d07af9d2d3124b8f49eadda7c21b44
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed,  2 Apr 2008 16:13:53 -0300

bugs: precheck must use check (instead of assert) and ensures that
code size is at least 1

Diffstat:
Mldebug.c | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ldebug.c b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.37 2007/05/29 18:59:59 roberto Exp roberto $ +** $Id: ldebug.c,v 2.38 2008/04/02 16:16:06 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -280,12 +280,11 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { static int precheck (const Proto *pt) { check(pt->maxstacksize <= MAXSTACK); - lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); - lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) || - (pt->is_vararg & VARARG_HASARG)); - check(pt->sizeupvalues <= pt->nups); + check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); + check(!(pt->is_vararg & VARARG_NEEDSARG) || (pt->is_vararg & VARARG_HASARG)); + check(pt->sizeupvalues == pt->nups || pt->sizeupvalues == 0); check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); - check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); + check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); return 1; }