diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 | */ |
756 | static void str2K (FuncState *fs, expdesc *e) { | 756 | static 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 | */ |
1309 | void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { | 1310 | void 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 | ||