]> granicus.if.org Git - php/commitdiff
Simplify code
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 19 Feb 2018 20:38:10 +0000 (21:38 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 19 Feb 2018 20:38:10 +0000 (21:38 +0100)
If operator overloading is ignored tmp will be 0 and we can still
use |=. No need to separate this into two cases.

ext/opcache/Optimizer/zend_inference.c

index 08ae51667e10cf74e7fb8c8f323aead68aa6e404..346958b65116a12f8c1159b6d6ec54eb1f356c1f 100644 (file)
@@ -2161,11 +2161,7 @@ static uint32_t binary_op_result_type(
                         * handling */
                        break;
                case ZEND_MOD:
-                       if (ZEND_OPTIMIZER_IGNORE_OVERLOADING & optimization_level) {
-                               tmp = MAY_BE_LONG;
-                       } else {
-                               tmp |= MAY_BE_LONG;
-                       }
+                       tmp |= MAY_BE_LONG;
                        /* Division by zero results in an exception, so it doesn't need any special handling */
                        break;
                case ZEND_BW_OR:
@@ -2180,11 +2176,7 @@ static uint32_t binary_op_result_type(
                        break;
                case ZEND_SL:
                case ZEND_SR:
-                       if (ZEND_OPTIMIZER_IGNORE_OVERLOADING & optimization_level) {
-                               tmp = MAY_BE_LONG;
-                       } else {
-                               tmp |= MAY_BE_LONG;
-                       }
+                       tmp |= MAY_BE_LONG;
                        break;
                case ZEND_CONCAT:
                case ZEND_FAST_CONCAT: