diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-09-07 14:39:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-09-07 14:39:10 -0300 |
commit | abdbe883a86bbc7fbf1d1bfc50756e1b42fc45b5 (patch) | |
tree | 051a7571c8acaf5451b5c9b7d67f1796a345c565 /lcode.c | |
parent | 4d0935ec0ffed827aade5594216fae15bed7c6b5 (diff) | |
download | lua-abdbe883a86bbc7fbf1d1bfc50756e1b42fc45b5.tar.gz lua-abdbe883a86bbc7fbf1d1bfc50756e1b42fc45b5.tar.bz2 lua-abdbe883a86bbc7fbf1d1bfc50756e1b42fc45b5.zip |
first implementation of unrestricted static scoping
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -273,6 +273,11 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { | |||
273 | e->k = VNONRELOC; | 273 | e->k = VNONRELOC; |
274 | break; | 274 | break; |
275 | } | 275 | } |
276 | case VUPVAL: { | ||
277 | e->u.i.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.i.info, 0); | ||
278 | e->k = VRELOCABLE; | ||
279 | break; | ||
280 | } | ||
276 | case VGLOBAL: { | 281 | case VGLOBAL: { |
277 | e->u.i.info = luaK_codeABc(fs, OP_GETGLOBAL, 0, e->u.i.info); | 282 | e->u.i.info = luaK_codeABc(fs, OP_GETGLOBAL, 0, e->u.i.info); |
278 | e->k = VRELOCABLE; | 283 | e->k = VRELOCABLE; |
@@ -437,6 +442,12 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *exp) { | |||
437 | luaK_exp2reg(fs, exp, var->u.i.info); | 442 | luaK_exp2reg(fs, exp, var->u.i.info); |
438 | break; | 443 | break; |
439 | } | 444 | } |
445 | case VUPVAL: { | ||
446 | int e = luaK_exp2anyreg(fs, exp); | ||
447 | freereg(fs, e); | ||
448 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.i.info, 0); | ||
449 | break; | ||
450 | } | ||
440 | case VGLOBAL: { | 451 | case VGLOBAL: { |
441 | int e = luaK_exp2anyreg(fs, exp); | 452 | int e = luaK_exp2anyreg(fs, exp); |
442 | freereg(fs, e); | 453 | freereg(fs, e); |