]> granicus.if.org Git - php/commitdiff
Eliminate unnecessary exception checks
authorDmitry Stogov <dmitry@zend.com>
Wed, 9 Sep 2020 13:15:37 +0000 (16:15 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 9 Sep 2020 13:15:37 +0000 (16:15 +0300)
ext/opcache/Optimizer/zend_inference.c

index 13e8f5d09490b33c900c5f491932c5f593296211..ed18c85e2b1191306251eb437f663c377d343415 100644 (file)
@@ -4631,6 +4631,18 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
                                return 1;
                        }
                        return 0;
+               case ZEND_FETCH_DIM_W:
+               case ZEND_FETCH_LIST_W:
+                       if ((t1 & (MAY_BE_ANY|MAY_BE_REF)) != MAY_BE_ARRAY) {
+                               return 1;
+                       }
+                       if (t2 & (MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT)) {
+                               return 1;
+                       }
+                       if (opline->op2_type == IS_UNUSED) {
+                               return 1;
+                       }
+                       return 0;
                default:
                        return 1;
        }