From 04aa96d28dcfb195e89163bc690e084cd754af9a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 20 Aug 2014 15:04:40 +0400 Subject: [PATCH] Removed a hack that allowed passing of function return value by reference depending on value of reference-counter (Fixed Zend/tests/bug35393.phpt test failure) --- Zend/zend_vm_def.h | 5 +---- Zend/zend_vm_execute.h | 10 ++-------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index c71a0b7ed35..a50f1431567 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3077,10 +3077,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || (Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) && - ((!Z_REFCOUNTED_P(varptr) && Z_TYPE_P(varptr) != IS_STRING) || - Z_ISREF_P(varptr) || - Z_TYPE_P(varptr) == IS_OBJECT || - (Z_REFCOUNTED_P(varptr) && Z_REFCOUNT_P(varptr) == 1))) { + (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) { ZVAL_MAKE_REF(varptr); if (OP1_TYPE == IS_CV) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 40dab7a2d20..f1909b65ce8 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -13554,10 +13554,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || (Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) && - ((!Z_REFCOUNTED_P(varptr) && Z_TYPE_P(varptr) != IS_STRING) || - Z_ISREF_P(varptr) || - Z_TYPE_P(varptr) == IS_OBJECT || - (Z_REFCOUNTED_P(varptr) && Z_REFCOUNT_P(varptr) == 1))) { + (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) { ZVAL_MAKE_REF(varptr); if (IS_VAR == IS_CV) { @@ -30934,10 +30931,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || (Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) && - ((!Z_REFCOUNTED_P(varptr) && Z_TYPE_P(varptr) != IS_STRING) || - Z_ISREF_P(varptr) || - Z_TYPE_P(varptr) == IS_OBJECT || - (Z_REFCOUNTED_P(varptr) && Z_REFCOUNT_P(varptr) == 1))) { + (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) { ZVAL_MAKE_REF(varptr); if (IS_CV == IS_CV) {