From 170fd797a2be22abae6bd406f35fb50236988551 Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Wed, 17 Feb 2021 20:29:28 +0000 Subject: [PATCH] It seems that we don't really need this - must be the bug was elsewhere --- src/lcode.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lcode.c b/src/lcode.c index a0abb2a..8a127a0 100644 --- a/src/lcode.c +++ b/src/lcode.c @@ -1201,16 +1201,6 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { t->u.ind.idx = luaK_exp2RK(fs, k); /* R/K index for key */ t->u.ind.vt = (t->k == VUPVAL) ? VUPVAL : VLOCAL; t->k = VINDEXED; - /* - RAVI - when parsing something like (10)[3] - t->ravi_type is RAVI_TNUMINT - which is wrong so we need to check for this situation. Problem is that - because of metatables the index [] operator can even be applied to numeric - values (see for example Lua test events.lua) so we can't raise an error - here. - */ - if (t->ravi_type != RAVI_TTABLE && t->ravi_type != RAVI_TARRAYFLT && t->ravi_type != RAVI_TARRAYINT) { - t->ravi_type = RAVI_TANY; - } }