From a1ef58b3a5986293ed0b7acef50073d94c7f932f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Oct 2017 18:56:32 -0300 Subject: eplicit 1-bit opcode operand 'k' --- ldebug.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 67b9496a..41eaf68c 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.130 2017/07/10 17:35:12 roberto Exp roberto $ +** $Id: ldebug.c,v 2.131 2017/10/04 15:49:24 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -402,7 +402,7 @@ static const char *getobjname (Proto *p, int lastpc, int reg, ** Find a "name" for the constant 'c'. */ static void kname (Proto *p, int c, const char **name) { - TValue *kvalue = &p->k[INDEXK(c)]; + TValue *kvalue = &p->k[c]; *name = (ttisstring(kvalue)) ? svalue(kvalue) : "?"; } @@ -418,17 +418,17 @@ static void rname (Proto *p, int pc, int c, const char **name) { /* -** Find a "name" for the R/K index 'c'. +** Find a "name" for a 'C' value in an RK instruction. */ -static void rkname (Proto *p, int pc, int c, const char **name) { - if (ISK(c)) /* is 'c' a constant? */ - kname(p, INDEXK(c), name); +static void rkname (Proto *p, int pc, Instruction i, const char **name) { + int c = GETARG_C(i); /* key index */ + if (GETARG_k(i)) /* is 'c' a constant? */ + kname(p, c, name); else /* 'c' is a register */ rname(p, pc, c, name); } - static int filterpc (int pc, int jmptarget) { if (pc < jmptarget) /* is code conditional (inside a jump)? */ return -1; /* cannot know who sets that register */ @@ -549,8 +549,7 @@ static const char *gxf (Proto *p, int pc, Instruction i, int isup) { break; } case OP_SELF: { - int k = GETARG_C(i); /* key index */ - rkname(p, pc, k, name); + rkname(p, pc, i, name); return "method"; } default: break; /* go through to return NULL */ -- cgit v1.2.3-55-g6feb