aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldebug.c2
-rw-r--r--testes/errors.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/ldebug.c b/ldebug.c
index 8df5f5f2..2665ec7b 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -580,7 +580,7 @@ static const char *getobjname (const Proto *p, int lastpc, int reg,
580 kname(p, k, name); 580 kname(p, k, name);
581 return isEnv(p, lastpc, i, 1); 581 return isEnv(p, lastpc, i, 1);
582 } 582 }
583 case OP_GETTABLE: { 583 case OP_GETTABLE: case OP_GETVARG: {
584 int k = GETARG_C(i); /* key index */ 584 int k = GETARG_C(i); /* key index */
585 rname(p, lastpc, k, name); 585 rname(p, lastpc, k, name);
586 return isEnv(p, lastpc, i, 0); 586 return isEnv(p, lastpc, i, 0);
diff --git a/testes/errors.lua b/testes/errors.lua
index c9d85099..c82d5b3b 100644
--- a/testes/errors.lua
+++ b/testes/errors.lua
@@ -159,6 +159,9 @@ assert(not string.find(doit"aaa={13}; local bbbb=1; aaa[bbbb](3)", "'bbbb'"))
159checkmessage("aaa={13}; local bbbb=1; aaa[bbbb](3)", "number") 159checkmessage("aaa={13}; local bbbb=1; aaa[bbbb](3)", "number")
160checkmessage("aaa=(1)..{}", "a table value") 160checkmessage("aaa=(1)..{}", "a table value")
161 161
162checkmessage("local function foo (...t) return t.xx + 1 end; foo()",
163 "field 'xx'")
164
162-- bug in 5.4.6 165-- bug in 5.4.6
163checkmessage("a = {_ENV = {}}; print(a._ENV.x + 1)", "field 'x'") 166checkmessage("a = {_ENV = {}}; print(a._ENV.x + 1)", "field 'x'")
164 167