]> granicus.if.org Git - php/commitdiff
Prevent incorrect optimization
authorDmitry Stogov <dmitry@zend.com>
Tue, 28 Jul 2020 16:02:08 +0000 (19:02 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 28 Jul 2020 16:02:08 +0000 (19:02 +0300)
ext/opcache/jit/zend_jit_x86.dasc

index 9229b278f130a3f78079c17b5bb390c3f5b2b6b1..0c8d847dec268e8e097623eb7f54596f008b15d7 100644 (file)
@@ -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 {