diff options
| author | Anatol Belski <ab@php.net> | 2014-10-13 19:02:22 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-10-13 19:02:22 +0200 |
| commit | 766eb0103fe8f59c00ddadc5c5767093ee35b2e8 (patch) | |
| tree | f11b01c33784791330f5f524faed6dab9c04766b /Zend | |
| parent | 19c41e1f538e854fa8450715791c44f55e909588 (diff) | |
| parent | 65eb8ef8d040976e81b5f7b11e74013218cd1428 (diff) | |
| download | php-git-766eb0103fe8f59c00ddadc5c5767093ee35b2e8.tar.gz | |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
fix several datatype mismatch warnings
fix signed/unsigned mismatch warning
more signed/unsigned mismatch fix
fix signed/unsigned mismatch warning
fix signed/unsigned mismatch
fix some signed/unsigned mismatch
missing include for strlen proto
More fixes for array/object casts with temporary variables
Fix array/object cast of refcounted tmp var
Deref right value for compound assign ops
Diffstat (limited to 'Zend')
| -rw-r--r-- | Zend/tests/bw_or_assign_with_ref.phpt | 14 | ||||
| -rw-r--r-- | Zend/tests/double_array_cast.phpt | 18 | ||||
| -rw-r--r-- | Zend/tests/object_array_cast.phpt | 47 | ||||
| -rw-r--r-- | Zend/zend_execute.c | 4 | ||||
| -rw-r--r-- | Zend/zend_generators.c | 4 | ||||
| -rw-r--r-- | Zend/zend_indent.c | 6 | ||||
| -rw-r--r-- | Zend/zend_vm_def.h | 25 | ||||
| -rw-r--r-- | Zend/zend_vm_execute.h | 136 |
8 files changed, 149 insertions, 105 deletions
diff --git a/Zend/tests/bw_or_assign_with_ref.phpt b/Zend/tests/bw_or_assign_with_ref.phpt new file mode 100644 index 0000000000..27ccf6299b --- /dev/null +++ b/Zend/tests/bw_or_assign_with_ref.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bitwise or assign with referenced value +--FILE-- +<?php + +$num1 = 1; +$num2 = '2'; +$ref =& $num2; +$num1 |= $num2; +var_dump($num1); + +?> +--EXPECT-- +int(3) diff --git a/Zend/tests/double_array_cast.phpt b/Zend/tests/double_array_cast.phpt new file mode 100644 index 0000000000..aaee8cd919 --- /dev/null +++ b/Zend/tests/double_array_cast.phpt @@ -0,0 +1,18 @@ +--TEST-- +Double array cast +--FILE-- +<?php + +$array = [1, 2, $x = 3]; +var_dump((array) (array) $array); + +?> +--EXPECT-- +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/Zend/tests/object_array_cast.phpt b/Zend/tests/object_array_cast.phpt new file mode 100644 index 0000000000..1cf3dbbd9c --- /dev/null +++ b/Zend/tests/object_array_cast.phpt @@ -0,0 +1,47 @@ +--TEST-- +(object) (array) and (array) (object) casts +--FILE-- +<?php + +$arr = [1, 2, 3]; +var_dump((object) (array) $arr); +var_dump($arr); + +$obj = (object) [1, 2, 3]; +var_dump((array) (object) $obj); +var_dump($obj); + +?> +--EXPECT-- +object(stdClass)#1 (3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +object(stdClass)#1 (3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a3f18b960f..58038c94a4 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1522,7 +1522,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu } /* Initialize CV variables (skip arguments) */ - if (EXPECTED(num_args < op_array->last_var)) { + if (EXPECTED((int)num_args < op_array->last_var)) { zval *var = EX_VAR_NUM(num_args); zval *end = EX_VAR_NUM(op_array->last_var); @@ -1621,7 +1621,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da } /* Initialize CV variables (skip arguments) */ - if (EXPECTED(num_args < op_array->last_var)) { + if (EXPECTED((int)num_args < op_array->last_var)) { zval *var = EX_VAR_NUM(num_args); zval *end = EX_VAR_NUM(op_array->last_var); diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index c0d087fd99..b38657f7b7 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -52,9 +52,9 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato if (brk_cont->start < 0) { continue; - } else if (brk_cont->start > op_num) { + } else if ((uint32_t)brk_cont->start > op_num) { break; - } else if (brk_cont->brk > op_num) { + } else if (brk_cont->brk >= 0 && (uint32_t)brk_cont->brk > op_num) { zend_op *brk_opline = op_array->opcodes + brk_cont->brk; if (brk_opline->opcode == ZEND_FREE) { diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index 5ebc4527e2..93c10108f8 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -52,9 +52,9 @@ ZEND_API void zend_indent(TSRMLS_D) zval token; int token_type; int in_string=0; - int nest_level=0; - int emit_whitespace[256]; - int i; + unsigned int nest_level=0; + unsigned int emit_whitespace[256]; + unsigned int i; memset(emit_whitespace, 0, sizeof(int)*256); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 091b384c33..af532e88e4 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -343,7 +343,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -444,7 +444,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMP|VAR zval *dim = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, OP2_TYPE TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -497,7 +497,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU zval *value; SAVE_OPLINE(); - value = GET_OP2_ZVAL_PTR(BP_VAR_R); + value = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -4043,7 +4043,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } - FREE_OP1(); + FREE_OP1_IF_VAR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4058,15 +4058,13 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (OP1_TYPE != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (OP1_TYPE != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + Z_ADDREF_P(result); convert_to_array(result); } } else { @@ -4078,23 +4076,18 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (OP1_TYPE != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (OP1_TYPE != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + zval_opt_copy_ctor(result); convert_to_object(result); } } - - FREE_OP1_IF_VAR(); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); } + FREE_OP1(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 9f8be5ceb0..0768aa6df2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2893,15 +2893,13 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_CONST != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_CONST != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + Z_ADDREF_P(result); convert_to_array(result); } } else { @@ -2913,21 +2911,16 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_CONST != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_CONST != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + zval_opt_copy_ctor(result); convert_to_object(result); } } - - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); } CHECK_EXCEPTION(); @@ -9695,7 +9688,6 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } - zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9710,15 +9702,13 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_TMP_VAR != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_TMP_VAR != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + Z_ADDREF_P(result); convert_to_array(result); } } else { @@ -9730,22 +9720,18 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_TMP_VAR != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_TMP_VAR != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + zval_opt_copy_ctor(result); convert_to_object(result); } } - - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); } + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16431,15 +16417,13 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_VAR != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_VAR != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + Z_ADDREF_P(result); convert_to_array(result); } } else { @@ -16451,23 +16435,18 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_VAR != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_VAR != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + zval_opt_copy_ctor(result); convert_to_object(result); } } - - zval_ptr_dtor_nogc(free_op1.var); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); } + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -17543,7 +17522,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -17643,7 +17622,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b zval *dim = opline->op2.zv; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CONST TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -19980,7 +19959,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -20081,7 +20060,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_TMP_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -21992,7 +21971,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -22093,7 +22072,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -22146,7 +22125,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -24098,7 +24077,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -24198,7 +24177,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (* zval *dim = NULL; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_UNUSED TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -25571,7 +25550,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -25671,7 +25650,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina zval *dim = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CV TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -25724,7 +25703,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -27441,7 +27420,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -27540,7 +27519,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int zval *dim = opline->op2.zv; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CONST TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -28831,7 +28810,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -28931,7 +28910,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (* zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_TMP_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -30139,7 +30118,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -30239,7 +30218,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (* zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -30292,7 +30271,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); var_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -31447,7 +31426,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -31546,7 +31525,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int zval *dim = NULL; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_UNUSED TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -31966,7 +31945,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -32065,7 +32044,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b zval *dim = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CV TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -32118,7 +32097,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); var_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -34080,15 +34059,13 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_CV != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_CV != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + Z_ADDREF_P(result); convert_to_array(result); } } else { @@ -34100,21 +34077,16 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) { zval_copy_ctor_func(expr); } - } else if (IS_CV != IS_TMP_VAR) { + } else { if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } } } else { ZVAL_COPY_VALUE(result, expr); - if (IS_CV != IS_TMP_VAR) { - zval_opt_copy_ctor(result); - } + zval_opt_copy_ctor(result); convert_to_object(result); } } - - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); } CHECK_EXCEPTION(); @@ -34947,7 +34919,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -35046,7 +35018,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi zval *dim = opline->op2.zv; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CONST TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -37217,7 +37189,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -37317,7 +37289,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_TMP_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -39101,7 +39073,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -39201,7 +39173,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_VAR(int (*bina zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_VAR TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -39254,7 +39226,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { @@ -41078,7 +41050,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -41177,7 +41149,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b zval *dim = NULL; zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_UNUSED TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -42407,7 +42379,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar object = make_real_object(object TSRMLS_CC); } - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); @@ -42506,7 +42478,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar zval *dim = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address_RW(EX_VAR((opline+1)->op2.var), container, dim, IS_CV TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } @@ -42559,7 +42531,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { |
