]> granicus.if.org Git - php/commitdiff
Update array_element_type inference for previous change
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 25 Jun 2018 12:27:02 +0000 (14:27 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 25 Jun 2018 12:27:02 +0000 (14:27 +0200)
LIST_R and DIM_IS return value can't be MAY_BE_REF anymore.

ext/opcache/Optimizer/zend_inference.c

index b49fa61e31cc8c27abbc2f3143c62b20b73ca9c1..650a458df7e00fdf0e48eae0cff36d2d6b0e9eba 100644 (file)
@@ -2059,7 +2059,7 @@ uint32_t zend_array_element_type(zend_op *opline, uint32_t t1)
                                tmp |= MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
                        }
                        if (t1 & MAY_BE_ARRAY_OF_REF) {
-                               if (opline->opcode == ZEND_FETCH_DIM_R) {
+                               if (!write) {
                                        /* can't be REF  because of ZVAL_COPY_DEREF() usage */
                                        tmp |= MAY_BE_RC1 | MAY_BE_RCN;
                                } else {