Browse Source

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.
pull/2894/head
Nikita Popov 8 years ago
parent
commit
625d7075d6
  1. 10
      Zend/zend_ast.c

10
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);
}

Loading…
Cancel
Save