From 18d3e82cfef08b60cba316dccb8f0830d311b439 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 3 Jul 2001 14:01:34 -0300 Subject: [PATCH] check C is independent from check B --- ldebug.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ldebug.c b/ldebug.c index 3e73d374..1f961ec1 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.85 2001/06/28 14:57:17 roberto Exp roberto $ +** $Id: ldebug.c,v 1.86 2001/06/28 19:58:57 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -354,11 +354,11 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { case iABC: { b = GETARG_B(i); c = GETARG_C(i); - if (testOpMode(op, OpModeBreg)) { + if (testOpMode(op, OpModeBreg)) checkreg(pt, b); + if (testOpMode(op, OpModeCreg)) check(c < pt->maxstacksize || (c >= MAXSTACK && c-MAXSTACK < pt->sizek)); - } break; } case iABc: { @@ -397,7 +397,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { break; } case OP_CONCAT: { - check(b < c); /* at least two operands */ + /* `c' is a register, and at least two operands */ + check(c < MAXSTACK && b < c); break; } case OP_JMP: