From 625d7075d6e2c74d2cdff7091034092e4edd465a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 2 Nov 2017 19:20:14 +0100 Subject: [PATCH] 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. --- Zend/zend_ast.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 884caf2be2c..f4e7c09a83d 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); }