From 251e667488fffa39f900c686a7df862aeade176b Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 28 Jul 2020 19:02:08 +0300 Subject: [PATCH] Prevent incorrect optimization --- ext/opcache/jit/zend_jit_x86.dasc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 9229b278f1..0c8d847dec 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -4083,7 +4083,8 @@ static int zend_jit_math_double_long(dasm_State **Dst, { zend_reg result_reg; - if (zend_is_commutative(opcode)) { + if (zend_is_commutative(opcode) + && (Z_MODE(res_addr) != IS_REG || Z_MODE(op1_addr) != IS_REG || Z_REG(res_addr) != Z_REG(op1_addr))) { if (Z_MODE(res_addr) == IS_REG) { result_reg = Z_REG(res_addr); } else { -- 2.50.1