From: Nikita Popov Date: Thu, 2 Nov 2017 18:20:14 +0000 (+0100) Subject: Don't dup after fetch_dimension_const X-Git-Tag: php-7.3.0alpha1~1099^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=625d7075d6e2c74d2cdff7091034092e4edd465a;p=php Don't dup after fetch_dimension_const Any duplication that may be necessary must have happened earlier already. Also I'm not sure what the IS_REF branch was there for originally, but it does not appear to be relevant anymore. --- diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 884caf2be2..f4e7c09a83 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -452,16 +452,8 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc zval_dtor(&op1); ret = FAILURE; } else { - zval tmp; + zend_fetch_dimension_const(result, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R); - zend_fetch_dimension_const(&tmp, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R); - - if (UNEXPECTED(Z_ISREF(tmp))) { - ZVAL_COPY_OR_DUP(result, Z_REFVAL(tmp)); - } else { - ZVAL_COPY_OR_DUP(result, &tmp); - } - zval_ptr_dtor(&tmp); zval_dtor(&op1); zval_dtor(&op2); }