diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-05 13:26:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-05 13:26:37 -0300 |
commit | d394d5536aeccb937fb6fd8e7476b08d672bc892 (patch) | |
tree | 82483d3792049e16b5dc8e2573d661ca2acd9573 /ldebug.c | |
parent | a2f98314a30859b217d6f7f7741c785a8e029e3c (diff) | |
download | lua-d394d5536aeccb937fb6fd8e7476b08d672bc892.tar.gz lua-d394d5536aeccb937fb6fd8e7476b08d672bc892.tar.bz2 lua-d394d5536aeccb937fb6fd8e7476b08d672bc892.zip |
new macro 'eqstr'
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.66 2010/03/12 19:14:06 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.67 2010/03/13 15:55:42 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -300,11 +300,11 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int reg, | |||
300 | if (reg == a) { | 300 | if (reg == a) { |
301 | int k = GETARG_C(i); /* key index */ | 301 | int k = GETARG_C(i); /* key index */ |
302 | int t = GETARG_B(i); | 302 | int t = GETARG_B(i); |
303 | const char *tabname = (op == OP_GETTABLE) | 303 | const char *vn = (op == OP_GETTABLE) /* name of indexed variable */ |
304 | ? luaF_getlocalname(p, t + 1, pc) | 304 | ? luaF_getlocalname(p, t + 1, pc) |
305 | : getstr(p->upvalues[t].name); | 305 | : getstr(p->upvalues[t].name); |
306 | kname(p, k, a, what, name); | 306 | kname(p, k, a, what, name); |
307 | what = (tabname == getstr(G(L)->envn)) ? "global" : "field"; | 307 | what = (vn && strcmp(vn, "_ENV") == 0) ? "global" : "field"; |
308 | } | 308 | } |
309 | break; | 309 | break; |
310 | } | 310 | } |
@@ -427,7 +427,7 @@ static const char *getupvalname (CallInfo *ci, const TValue *o, | |||
427 | LClosure *c = &ci_func(ci)->l; | 427 | LClosure *c = &ci_func(ci)->l; |
428 | int i; | 428 | int i; |
429 | for (i = 0; i < c->nupvalues; i++) { | 429 | for (i = 0; i < c->nupvalues; i++) { |
430 | if (c->upvals[i]->v == o) { | 430 | if (eqstr(c->upvals[i]->v, o)) { |
431 | *name = getstr(c->p->upvalues[i].name); | 431 | *name = getstr(c->p->upvalues[i].name); |
432 | return "upvalue"; | 432 | return "upvalue"; |
433 | } | 433 | } |