From abdbe883a86bbc7fbf1d1bfc50756e1b42fc45b5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 7 Sep 2001 14:39:10 -0300 Subject: first implementation of unrestricted static scoping --- lcode.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index d1b5355a..de26964b 100644 --- a/lcode.c +++ b/lcode.c @@ -273,6 +273,11 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { e->k = VNONRELOC; break; } + case VUPVAL: { + e->u.i.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.i.info, 0); + e->k = VRELOCABLE; + break; + } case VGLOBAL: { e->u.i.info = luaK_codeABc(fs, OP_GETGLOBAL, 0, e->u.i.info); e->k = VRELOCABLE; @@ -437,6 +442,12 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *exp) { luaK_exp2reg(fs, exp, var->u.i.info); break; } + case VUPVAL: { + int e = luaK_exp2anyreg(fs, exp); + freereg(fs, e); + luaK_codeABC(fs, OP_SETUPVAL, e, var->u.i.info, 0); + break; + } case VGLOBAL: { int e = luaK_exp2anyreg(fs, exp); freereg(fs, e); -- cgit v1.2.3-55-g6feb