From dd6c6b1c483ac3578a7e89e4e445a0c5ec560620 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 16 Apr 2016 14:32:48 +0200 Subject: [PATCH] Cleanup condition in SEND_VAR_NO_REF Was overly convoluted after the IS_VAR_RET_REF removal. --- Zend/zend_vm_def.h | 10 +++++----- Zend/zend_vm_execute.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 6c9adea30b..e8a9ab2890 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4272,11 +4272,11 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR, NUM, SEND) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - Z_ISREF_P(varptr)) && - (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) { - - ZVAL_MAKE_REF(varptr); + if (Z_ISREF_P(varptr)) { + /* nothing to do */ + } else if (!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) + && Z_TYPE_P(varptr) == IS_OBJECT) { + ZVAL_NEW_REF(varptr, varptr); } else { if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? !(opline->extended_value & ZEND_ARG_SEND_SILENT) : diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0fc6899535..04e3cf0f75 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -15500,11 +15500,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDL varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - Z_ISREF_P(varptr)) && - (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) { - - ZVAL_MAKE_REF(varptr); + if (Z_ISREF_P(varptr)) { + /* nothing to do */ + } else if (!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) + && Z_TYPE_P(varptr) == IS_OBJECT) { + ZVAL_NEW_REF(varptr, varptr); } else { if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? !(opline->extended_value & ZEND_ARG_SEND_SILENT) : -- 2.40.0