]> granicus.if.org Git - php/commitdiff
More accurate reference counting inference
authorDmitry Stogov <dmitry@zend.com>
Thu, 17 Aug 2017 17:03:12 +0000 (20:03 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 17 Aug 2017 17:03:12 +0000 (20:03 +0300)
ext/opcache/Optimizer/zend_inference.c

index 6457c931778dec0b3959c7315b8a576bdfe4f27a..9d5d6cfea54065a7efce0f4edac7d1ae39d3ae5d 100644 (file)
@@ -2978,13 +2978,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
                                                }
                                                tmp |= MAY_BE_ARRAY | MAY_BE_RC1;
                                        }
-                                       if (t1 & MAY_BE_STRING) {
-                                               tmp |= MAY_BE_RC1;
-                                       }
-                                       if (t1 & MAY_BE_ARRAY) {
+                                       if (t1 & (MAY_BE_STRING|MAY_BE_ARRAY)) {
                                                tmp |= MAY_BE_RC1;
                                                if (opline->opcode == ZEND_FETCH_DIM_FUNC_ARG) {
-                                                       tmp |= MAY_BE_RCN;
+                                                       tmp |= t1 & MAY_BE_RCN;
                                                }
                                        }
                                        if (t1 & (MAY_BE_OBJECT|MAY_BE_RESOURCE)) {