aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lcode.c b/lcode.c
index 08e92ea1..f2c9de7b 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.133 2017/11/16 12:59:14 roberto Exp roberto $ 2** $Id: lcode.c,v 2.134 2017/11/22 18:41:20 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*/
@@ -969,7 +969,7 @@ static void negatecondition (FuncState *fs, expdesc *e) {
969 Instruction *pc = getjumpcontrol(fs, e->u.info); 969 Instruction *pc = getjumpcontrol(fs, e->u.info);
970 lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && 970 lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET &&
971 GET_OPCODE(*pc) != OP_TEST); 971 GET_OPCODE(*pc) != OP_TEST);
972 SETARG_A(*pc, !(GETARG_A(*pc))); 972 SETARG_B(*pc, !(GETARG_B(*pc)));
973} 973}
974 974
975 975
@@ -1286,12 +1286,12 @@ static void codeorder (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
1286 case OPR_GT: case OPR_GE: { 1286 case OPR_GT: case OPR_GE: {
1287 /* '(a > b)' ==> '(b < a)'; '(a >= b)' ==> '(b <= a)' */ 1287 /* '(a > b)' ==> '(b < a)'; '(a >= b)' ==> '(b <= a)' */
1288 OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ); 1288 OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ);
1289 e1->u.info = condjump(fs, op, 1, rk2, rk1); /* invert operands */ 1289 e1->u.info = condjump(fs, op, rk2, 1, rk1); /* invert operands */
1290 break; 1290 break;
1291 } 1291 }
1292 default: { /* '==', '<', '<=' use their own opcodes */ 1292 default: { /* '==', '<', '<=' use their own opcodes */
1293 OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ); 1293 OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ);
1294 e1->u.info = condjump(fs, op, 1, rk1, rk2); 1294 e1->u.info = condjump(fs, op, rk1, 1, rk2);
1295 break; 1295 break;
1296 } 1296 }
1297 } 1297 }
@@ -1325,7 +1325,7 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
1325 r2 = luaK_exp2anyreg(fs, e2); 1325 r2 = luaK_exp2anyreg(fs, e2);
1326 } 1326 }
1327 freeexps(fs, e1, e2); 1327 freeexps(fs, e1, e2);
1328 e1->u.info = condjump(fs, op, (opr == OPR_EQ), r1, r2); 1328 e1->u.info = condjump(fs, op, r1, (opr == OPR_EQ), r2);
1329 e1->k = VJMP; 1329 e1->k = VJMP;
1330} 1330}
1331 1331