From 752d6849712e17b510f6fed8c74987ad3aba1c73 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 5 Feb 2018 20:43:08 +0300 Subject: [PATCH] Removed "dead" code --- Zend/zend_vm_def.h | 33 ++++++++++----------------------- Zend/zend_vm_execute.h | 33 ++++++++++----------------------- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 1a2f5c402d..e95b6ece72 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4471,33 +4471,20 @@ ZEND_VM_HOT_HANDLER(185, ZEND_SEND_FUNC_ARG, VAR, NUM) } varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); - if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { - SAVE_OPLINE(); - GET_OP1_UNDEF_CV(varptr, BP_VAR_R); - arg = ZEND_CALL_VAR(EX(call), opline->result.var); - ZVAL_NULL(arg); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); - } - arg = ZEND_CALL_VAR(EX(call), opline->result.var); - if (OP1_TYPE == IS_CV) { - ZVAL_OPT_DEREF(varptr); - ZVAL_COPY(arg, varptr); - } else /* if (OP1_TYPE == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(varptr))) { - zend_refcounted *ref = Z_COUNTED_P(varptr); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); - varptr = Z_REFVAL_P(varptr); - ZVAL_COPY_VALUE(arg, varptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(arg)) { - Z_ADDREF_P(arg); - } - } else { - ZVAL_COPY_VALUE(arg, varptr); + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); } + } else { + ZVAL_COPY_VALUE(arg, varptr); } ZEND_VM_NEXT_OPCODE(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 8c7727003d..374be547a4 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -22053,33 +22053,20 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_FUNC_ARG_SPEC } varptr = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC); - if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { - SAVE_OPLINE(); - GET_OP1_UNDEF_CV(varptr, BP_VAR_R); - arg = ZEND_CALL_VAR(EX(call), opline->result.var); - ZVAL_NULL(arg); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); - } - arg = ZEND_CALL_VAR(EX(call), opline->result.var); - if (IS_VAR == IS_CV) { - ZVAL_OPT_DEREF(varptr); - ZVAL_COPY(arg, varptr); - } else /* if (IS_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(varptr))) { - zend_refcounted *ref = Z_COUNTED_P(varptr); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); - varptr = Z_REFVAL_P(varptr); - ZVAL_COPY_VALUE(arg, varptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(arg)) { - Z_ADDREF_P(arg); - } - } else { - ZVAL_COPY_VALUE(arg, varptr); + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); } + } else { + ZVAL_COPY_VALUE(arg, varptr); } ZEND_VM_NEXT_OPCODE(); -- 2.40.0