diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.52 2011/04/07 18:14:12 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.53 2011/04/19 16:22:13 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -581,15 +581,15 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { | |||
581 | 581 | ||
582 | 582 | ||
583 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { | 583 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { |
584 | int func; | 584 | int ereg; |
585 | luaK_exp2anyreg(fs, e); | 585 | luaK_exp2anyreg(fs, e); |
586 | ereg = e->u.info; /* register where 'e' was placed */ | ||
586 | freeexp(fs, e); | 587 | freeexp(fs, e); |
587 | func = fs->freereg; | 588 | e->u.info = fs->freereg; /* base register for op_self */ |
588 | luaK_codeABC(fs, OP_SELF, func, e->u.info, luaK_exp2RK(fs, key)); | ||
589 | freeexp(fs, key); | ||
590 | luaK_reserveregs(fs, 2); | ||
591 | e->u.info = func; | ||
592 | e->k = VNONRELOC; | 589 | e->k = VNONRELOC; |
590 | luaK_reserveregs(fs, 2); /* function and 'self' produced by op_self */ | ||
591 | luaK_codeABC(fs, OP_SELF, e->u.info, ereg, luaK_exp2RK(fs, key)); | ||
592 | freeexp(fs, key); | ||
593 | } | 593 | } |
594 | 594 | ||
595 | 595 | ||