From f22d5d9eef7e0904d0fdfc517759037e04923fed Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 11 Jan 2013 12:19:05 +0100 Subject: [PATCH] Fix discharge order of comparisons in Lua parser. --- src/lj_parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lj_parse.c b/src/lj_parse.c index 92ebc046..7268d176 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c @@ -848,6 +848,7 @@ static void bcemit_comp(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2) if ((op-BC_ISLT) & 1) { /* GT -> LT, GE -> LE */ e1 = e2; e2 = eret; /* Swap operands. */ op = ((op-BC_ISLT)^3)+BC_ISLT; + expr_toval(fs, e1); } rd = expr_toanyreg(fs, e2); ra = expr_toanyreg(fs, e1);