From c764ca71a639f5585b5f466bea25dc42b855a4b0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 25 Apr 2022 14:42:51 -0300 Subject: [PATCH] Bug: Wrong code generation in bitwise operations --- src/lcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/src/lcode.c +++ b/src/lcode.c @@ -1531,7 +1531,7 @@ static void codecommutative (FuncState * static void codebitwise (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line) { int flip = 0; - if (e1->k == VKINT) { + if (e1->k == VKINT && luaK_exp2K(fs, e1)) { swapexps(e1, e2); /* 'e2' will be the constant operand */ flip = 1; }