From 4eb4a78bf06adc0d66de52559fcf7f74439adaf8 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 15 Feb 2016 11:12:04 +0800 Subject: [PATCH] Combine conditions (good for other VM kinds) --- Zend/zend_vm_def.h | 14 ++-- Zend/zend_vm_execute.h | 144 ++++++++++++++++++++--------------------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 178d2ebf3d..2ee1680650 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1744,7 +1744,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); FREE_UNFETCHED_OP2(); FREE_UNFETCHED_OP1(); @@ -2006,7 +2006,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST FREE_OP2(); HANDLE_EXCEPTION(); } - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); FREE_OP2(); FREE_OP1_VAR_PTR(); @@ -4058,14 +4058,14 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) ZVAL_NULL(EX(return_value)); } } else if (!EX(return_value)) { - if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_TMP_VAR ) { + if (OP1_TYPE & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) { SAVE_OPLINE(); zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1)); } } } else { - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); if (OP1_TYPE == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) { @@ -4103,7 +4103,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC) SAVE_OPLINE(); do { - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR || + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR)) || (OP1_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -4163,7 +4163,7 @@ ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, CONST|TMP|VAR|CV, ANY) retval = GET_OP1_ZVAL_PTR(BP_VAR_R); /* Copy return value into generator->retval */ - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); if (OP1_TYPE == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) { @@ -7482,7 +7482,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if (OP1_TYPE & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index e87f28e44d..8ba1688c0c 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3467,14 +3467,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND ZVAL_NULL(EX(return_value)); } } else if (!EX(return_value)) { - if (IS_CONST == IS_VAR || IS_CONST == IS_TMP_VAR ) { + if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) { SAVE_OPLINE(); zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1)); } } } else { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); if (IS_CONST == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) { @@ -3512,7 +3512,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDL SAVE_OPLINE(); do { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR || + if ((IS_CONST & (IS_CONST|IS_TMP_VAR)) || (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -3571,7 +3571,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HA retval = EX_CONSTANT(opline->op1); /* Copy return value into generator->retval */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); if (IS_CONST == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) { @@ -5509,7 +5509,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -5700,7 +5700,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ HANDLE_EXCEPTION(); } - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -6807,7 +6807,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -6978,7 +6978,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -7429,7 +7429,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -7808,7 +7808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -8459,7 +8459,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -9241,7 +9241,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -9432,7 +9432,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ HANDLE_EXCEPTION(); } - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -10286,7 +10286,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -11032,7 +11032,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -11225,7 +11225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); @@ -12019,14 +12019,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_O ZVAL_NULL(EX(return_value)); } } else if (!EX(return_value)) { - if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_TMP_VAR ) { + if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) { SAVE_OPLINE(); zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1)); } } } else { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); if (IS_TMP_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) { @@ -12064,7 +12064,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER SAVE_OPLINE(); do { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR || + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) || (IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -12123,7 +12123,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HAND retval = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); /* Copy return value into generator->retval */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); if (IS_TMP_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) { @@ -12937,7 +12937,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CO SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -13056,7 +13056,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CO HANDLE_EXCEPTION(); } - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -13312,7 +13312,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -13483,7 +13483,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEN if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -13654,7 +13654,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEN if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -13771,7 +13771,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UN SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -14006,7 +14006,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER( if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -14159,7 +14159,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -14278,7 +14278,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV HANDLE_EXCEPTION(); } - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -14534,7 +14534,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -14682,7 +14682,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TM SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -14802,7 +14802,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TM zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); @@ -15271,14 +15271,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_O ZVAL_NULL(EX(return_value)); } } else if (!EX(return_value)) { - if (IS_VAR == IS_VAR || IS_VAR == IS_TMP_VAR ) { + if (IS_VAR & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) { SAVE_OPLINE(); zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1)); } } } else { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); if (IS_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) { @@ -15316,7 +15316,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER SAVE_OPLINE(); do { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR || + if ((IS_VAR & (IS_CONST|IS_TMP_VAR)) || (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -15376,7 +15376,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HAND retval = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); /* Copy return value into generator->retval */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); if (IS_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) { @@ -17350,7 +17350,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CO SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -17538,7 +17538,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CO HANDLE_EXCEPTION(); } - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -19228,7 +19228,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -19456,7 +19456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEN if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -19740,7 +19740,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEN if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -20190,7 +20190,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UN SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -20967,7 +20967,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER( if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -21685,7 +21685,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -21873,7 +21873,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV HANDLE_EXCEPTION(); } - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -23536,7 +23536,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -24222,7 +24222,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TM SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -24411,7 +24411,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TM zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -26805,7 +26805,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED HANDLE_EXCEPTION(); } - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -28340,7 +28340,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLE if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -28475,7 +28475,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER( if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -28610,7 +28610,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER( if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -29268,7 +29268,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDL if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -30088,7 +30088,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED HANDLE_EXCEPTION(); } - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -31497,7 +31497,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -32322,7 +32322,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } - if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); @@ -34197,14 +34197,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OP ZVAL_NULL(EX(return_value)); } } else if (!EX(return_value)) { - if (IS_CV == IS_VAR || IS_CV == IS_TMP_VAR ) { + if (IS_CV & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) { SAVE_OPLINE(); zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1)); } } } else { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); if (IS_CV == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) { @@ -34242,7 +34242,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER( SAVE_OPLINE(); do { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR || + if ((IS_CV & (IS_CONST|IS_TMP_VAR)) || (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -34301,7 +34301,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDL retval = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); /* Copy return value into generator->retval */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); if (IS_CV == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) { @@ -36871,7 +36871,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CON SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -37131,7 +37131,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CON HANDLE_EXCEPTION(); } - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -39269,7 +39269,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZE if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -39638,7 +39638,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -40251,7 +40251,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -40962,7 +40962,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNU SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -41885,7 +41885,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(Z if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -43231,7 +43231,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_ SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -43491,7 +43491,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_ HANDLE_EXCEPTION(); } - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); @@ -45447,7 +45447,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_ if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { /* Constants and temporary variables aren't yieldable by reference, * but we still allow them with a notice. */ - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { zval *value; zend_error(E_NOTICE, "Only variable references should be yielded by reference"); @@ -46761,7 +46761,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP SAVE_OPLINE(); if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -47023,7 +47023,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { zend_throw_error(NULL, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); -- 2.40.0