From bf2b342ac1f080d06977bdf84475dc663c9a2644 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 13 Jun 2005 11:15:54 -0300 Subject: better control for compatibility code for varargs --- ldebug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 8cc7bbb3..a6fa2b58 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.20 2005/05/17 19:49:15 roberto Exp roberto $ +** $Id: ldebug.c,v 2.21 2005/05/31 14:25:18 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -276,7 +276,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { static int precheck (const Proto *pt) { check(pt->maxstacksize <= MAXSTACK); check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); - lua_assert(pt->numparams+pt->is_vararg <= pt->maxstacksize); + lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); return 1; } @@ -440,7 +440,8 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) { break; } case OP_VARARG: { - check(pt->is_vararg & NEWSTYLEVARARG); + check((pt->is_vararg & VARARG_ISVARARG) && + !(pt->is_vararg & VARARG_NEEDSARG)); b--; if (b == LUA_MULTRET) check(checkopenop(pt, pc)); checkreg(pt, a+b-1); -- cgit v1.2.3-55-g6feb