From 0a1b1acdd36a3ed4e6f1cadf62eec8531a437cbf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Jun 2001 11:56:42 -0300 Subject: details about opcode parameters --- ldebug.c | 96 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 62372fca..27494a4e 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.80 2001/06/08 12:29:27 roberto Exp roberto $ +** $Id: ldebug.c,v 1.81 2001/06/08 19:00:57 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -349,6 +349,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { int a = GETARG_A(i); int b = 0; int c = 0; + checkreg(pt, a); switch (getOpMode(op)) { case iABC: { b = GETARG_B(i); @@ -370,7 +371,6 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { break; } } - if (testOpMode(op, OpModeAreg)) checkreg(pt, a); if (testOpMode(op, OpModesetA)) { if (a == reg) last = pc; /* change register `a' */ } @@ -414,20 +414,20 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { break; } case OP_CALL: { - if (b == NO_REG) b = pt->maxstacksize; + if (b != NO_REG) { + checkreg(pt, a+b); + } if (c == NO_REG) { check(checkopenop(pt->code[pc+1])); - c = 1; } - check(b > a); - checkreg(pt, b-1); - checkreg(pt, c-1); + else if (c != 0) + checkreg(pt, a+c-1); if (reg >= a) last = pc; /* affect all registers above base */ break; } case OP_RETURN: { - if (b == NO_REG) b = pt->maxstacksize; - checkreg(pt, b-1); + if (b != NO_REG && b != 0) + checkreg(pt, a+b-1); break; } case OP_FORPREP: @@ -566,49 +566,49 @@ void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2) { #define opmode(t,a,b,c,sa,k,m) (((t)<