]> granicus.if.org Git - php/commitdiff
Fixed incorrect overflow detection
authorDmitry Stogov <dmitry@zend.com>
Thu, 27 Feb 2020 20:37:41 +0000 (23:37 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 27 Feb 2020 20:37:41 +0000 (23:37 +0300)
ext/opcache/Optimizer/zend_inference.c

index 961740bd5c4917aa4809976200a4dc7fc9d94699..7bddb827052c19d7368f4489f5bab2770e0dd998 100644 (file)
@@ -2626,10 +2626,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
                        }
                        if ((t1 & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_LONG) {
                                if (!ssa_var_info[ssa_ops[i].op1_use].has_range ||
-                                    (opline->opcode == ZEND_PRE_DEC &&
+                                    (opline->opcode == ZEND_POST_DEC &&
                                      (ssa_var_info[ssa_ops[i].op1_use].range.underflow ||
                                       ssa_var_info[ssa_ops[i].op1_use].range.min == ZEND_LONG_MIN)) ||
-                                     (opline->opcode == ZEND_PRE_INC &&
+                                     (opline->opcode == ZEND_POST_INC &&
                                       (ssa_var_info[ssa_ops[i].op1_use].range.overflow ||
                                        ssa_var_info[ssa_ops[i].op1_use].range.max == ZEND_LONG_MAX))) {
                                        /* may overflow */