** Check whether table being indexed by instruction 'i' is the ** environment '_ENV' */
| 550 | ** environment '_ENV' |
| 551 | */ |
| 552 | static const char *isEnv (const Proto *p, int pc, Instruction i, int isup) { |
| 553 | int t = GETARG_B(i); /* table index */ |
| 554 | const char *name; /* name of indexed variable */ |
| 555 | if (isup) /* is 't' an upvalue? */ |
| 556 | name = upvalname(p, t); |
| 557 | else /* 't' is a register */ |
| 558 | basicgetobjname(p, &pc, t, &name); |
| 559 | return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field"; |
| 560 | } |
| 561 | |
| 562 | |
| 563 | /* |
no test coverage detected