From: Dmitry Stogov Date: Mon, 6 Jun 2016 22:14:53 +0000 (+0300) Subject: cleanup X-Git-Tag: php-7.1.0alpha1~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=214d4613f523ac12a1fb5f06a9b3e98a47ed6e49;p=php cleanup --- diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 3131ef5ed8..2ec5c80bec 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -848,7 +848,7 @@ ZEND_VM_C_LABEL(assign_dim_op_convert_to_array): if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { ZEND_VM_C_GOTO(assign_dim_op_convert_to_array); } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(OP1_TYPE != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } ZEND_VM_C_LABEL(assign_dim_op_ret_null): @@ -4376,7 +4376,8 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, NUM) arg = ZEND_CALL_VAR(EX(call), opline->result.var); if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_ISERROR_P(varptr))) { - ZVAL_NEW_REF(arg, &EG(uninitialized_zval)); + ZVAL_NEW_EMPTY_REF(arg); + ZVAL_NULL(Z_REFVAL_P(arg)); ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a71db7c19b..f7bc9fb454 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -15717,7 +15717,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND arg = ZEND_CALL_VAR(EX(call), opline->result.var); if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(varptr))) { - ZVAL_NEW_REF(arg, &EG(uninitialized_zval)); + ZVAL_NEW_EMPTY_REF(arg); + ZVAL_NULL(Z_REFVAL_P(arg)); ZEND_VM_NEXT_OPCODE(); } @@ -17120,7 +17121,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_VAR != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -20684,7 +20685,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_VAR != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -22086,7 +22087,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_VAR != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -25175,7 +25176,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_VAR != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -28195,7 +28196,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_UNUSED != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -31065,7 +31066,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_UNUSED != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -31850,7 +31851,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_UNUSED != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -34388,7 +34389,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_UNUSED != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -37383,7 +37384,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_ arg = ZEND_CALL_VAR(EX(call), opline->result.var); if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(varptr))) { - ZVAL_NEW_REF(arg, &EG(uninitialized_zval)); + ZVAL_NEW_EMPTY_REF(arg); + ZVAL_NULL(Z_REFVAL_P(arg)); ZEND_VM_NEXT_OPCODE(); } @@ -39173,7 +39175,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_CV != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -43930,7 +43932,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_CV != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -46325,7 +46327,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_CV != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: @@ -50487,7 +50489,7 @@ assign_dim_op_convert_to_array: if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { goto assign_dim_op_convert_to_array; } - if (UNEXPECTED(!Z_ISERROR_P(container))) { + if (UNEXPECTED(IS_CV != IS_VAR || !Z_ISERROR_P(container))) { zend_error(E_WARNING, "Cannot use a scalar value as an array"); } assign_dim_op_ret_null: