diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 2.109 2016/05/13 19:09:21 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.110 2016/06/20 19:12:46 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 | */ |
| @@ -1015,11 +1015,14 @@ static void codeunexpval (FuncState *fs, OpCode op, expdesc *e, int line) { | |||
| 1015 | ** (everything but logical operators 'and'/'or' and comparison | 1015 | ** (everything but logical operators 'and'/'or' and comparison |
| 1016 | ** operators). | 1016 | ** operators). |
| 1017 | ** Expression to produce final result will be encoded in 'e1'. | 1017 | ** Expression to produce final result will be encoded in 'e1'. |
| 1018 | ** Because 'luaK_exp2RK' can free registers, its calls must be | ||
| 1019 | ** in "stack order" (that is, first on 'e2', which may have more | ||
| 1020 | ** recent registers to be released). | ||
| 1018 | */ | 1021 | */ |
| 1019 | static void codebinexpval (FuncState *fs, OpCode op, | 1022 | static void codebinexpval (FuncState *fs, OpCode op, |
| 1020 | expdesc *e1, expdesc *e2, int line) { | 1023 | expdesc *e1, expdesc *e2, int line) { |
| 1021 | int rk1 = luaK_exp2RK(fs, e1); /* both operands are "RK" */ | 1024 | int rk2 = luaK_exp2RK(fs, e2); /* both operands are "RK" */ |
| 1022 | int rk2 = luaK_exp2RK(fs, e2); | 1025 | int rk1 = luaK_exp2RK(fs, e1); |
| 1023 | freeexps(fs, e1, e2); | 1026 | freeexps(fs, e1, e2); |
| 1024 | e1->u.info = luaK_codeABC(fs, op, 0, rk1, rk2); /* generate opcode */ | 1027 | e1->u.info = luaK_codeABC(fs, op, 0, rk1, rk2); /* generate opcode */ |
| 1025 | e1->k = VRELOCABLE; /* all those operations are relocatable */ | 1028 | e1->k = VRELOCABLE; /* all those operations are relocatable */ |
