aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-11 11:51:58 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-11 11:51:58 -0300
commit5b1ab8efdcb7b48cab8148a407266c467d57114c (patch)
tree1ec673c0171801c24854220e0fbc7ef6c19c7ed1 /lcode.c
parent7ade1557627cf3f09c23c892ee227b7386f28414 (diff)
downloadlua-5b1ab8efdcb7b48cab8148a407266c467d57114c.tar.gz
lua-5b1ab8efdcb7b48cab8148a407266c467d57114c.tar.bz2
lua-5b1ab8efdcb7b48cab8148a407266c467d57114c.zip
'expdesc' doesn't depend on 'actvar' for var. info.
In preparation for 'global *', the structure 'expdesc' does not point to 'actvar.arr' for information about global variables.
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lcode.c b/lcode.c
index 119d91ab..7ca895f1 100644
--- a/lcode.c
+++ b/lcode.c
@@ -753,10 +753,11 @@ void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
753/* 753/*
754** Convert a VKSTR to a VK 754** Convert a VKSTR to a VK
755*/ 755*/
756static void str2K (FuncState *fs, expdesc *e) { 756static int str2K (FuncState *fs, expdesc *e) {
757 lua_assert(e->k == VKSTR); 757 lua_assert(e->k == VKSTR);
758 e->u.info = stringK(fs, e->u.strval); 758 e->u.info = stringK(fs, e->u.strval);
759 e->k = VK; 759 e->k = VK;
760 return e->u.info;
760} 761}
761 762
762 763
@@ -1307,8 +1308,9 @@ void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {
1307** values in registers. 1308** values in registers.
1308*/ 1309*/
1309void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { 1310void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
1311 int keystr = -1;
1310 if (k->k == VKSTR) 1312 if (k->k == VKSTR)
1311 str2K(fs, k); 1313 keystr = str2K(fs, k);
1312 lua_assert(!hasjumps(t) && 1314 lua_assert(!hasjumps(t) &&
1313 (t->k == VLOCAL || t->k == VNONRELOC || t->k == VUPVAL)); 1315 (t->k == VLOCAL || t->k == VNONRELOC || t->k == VUPVAL));
1314 if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ 1316 if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */
@@ -1336,7 +1338,8 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
1336 t->k = VINDEXED; 1338 t->k = VINDEXED;
1337 } 1339 }
1338 } 1340 }
1339 t->u.ind.vidx = -1; /* by default, not a declared global */ 1341 t->u.ind.keystr = keystr; /* string index in 'k' */
1342 t->u.ind.ro = 0; /* by default, not read-only */
1340} 1343}
1341 1344
1342 1345