From 856ee2e0ba81caebbf7f0fbbdede4f7cd9b8c9e0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 14 Feb 2016 16:49:36 +0100 Subject: [PATCH] Fixed bug #53432 --- Zend/tests/bug53432.phpt | 45 ++ Zend/tests/indexing_001.phpt | 41 +- Zend/zend_vm_def.h | 38 +- Zend/zend_vm_execute.h | 1072 ++++++++++++++-------------------- 4 files changed, 510 insertions(+), 686 deletions(-) create mode 100644 Zend/tests/bug53432.phpt diff --git a/Zend/tests/bug53432.phpt b/Zend/tests/bug53432.phpt new file mode 100644 index 0000000000000..f3e9159ab0614 --- /dev/null +++ b/Zend/tests/bug53432.phpt @@ -0,0 +1,45 @@ +--TEST-- +Bug #53432: Assignment via string index access on an empty string converts to array +--FILE-- +getMessage()}\n"; +} +var_dump($str); + +?> +--EXPECTF-- +string(1) "a" +string(1) "a" +string(1) "a" +string(6) " a" + +Warning: Illegal string offset: -1 in %s on line %d +NULL +string(0) "" + +Warning: Illegal string offset 'foo' in %s on line %d +string(1) "a" +string(1) "a" +Error: [] operator not supported for strings +string(0) "" diff --git a/Zend/tests/indexing_001.phpt b/Zend/tests/indexing_001.phpt index 0e466ab8cee24..f247a420b5f71 100644 --- a/Zend/tests/indexing_001.phpt +++ b/Zend/tests/indexing_001.phpt @@ -12,7 +12,7 @@ foreach ($testvalues as $testvalue) { } echo "\n*** Indexing - Testing reference assignment with key ***\n"; -$testvalues=array(null, 0, 1, true, false,'',0.1,array()); +$testvalues=array(null, 0, 1, true, false,0.1,array()); foreach ($testvalues as $testvalue) { $testvalue['foo']=&$array; @@ -20,7 +20,7 @@ foreach ($testvalues as $testvalue) { } echo "*** Indexing - Testing value assignment no key ***\n"; $array=array(1); -$testvalues=array(null, 0, 1, true, false,'',0.1,array()); +$testvalues=array(null, 0, 1, true, false,0.1,array()); foreach ($testvalues as $testvalue) { $testvalue[]=$array; @@ -28,7 +28,7 @@ foreach ($testvalues as $testvalue) { } echo "\n*** Indexing - Testing reference assignment no key ***\n"; -$testvalues=array(null, 0, 1, true, false,'',0.1,array()); +$testvalues=array(null, 0, 1, true, false,0.1,array()); foreach ($testvalues as $testvalue) { $testvalue[]=&$array; @@ -63,13 +63,11 @@ array(1) { int(1) } } -array(1) { - ["foo"]=> - array(1) { - [0]=> - int(1) - } -} + +Warning: Illegal string offset 'foo' in %s on line %d + +Notice: Array to string conversion in %s on line %d +string(1) "A" Warning: Illegal string offset 'foo' in %s on line %d @@ -110,13 +108,6 @@ array(1) { int(1) } } -array(1) { - ["foo"]=> - &array(1) { - [0]=> - int(1) - } -} Warning: Cannot use a scalar value as an array in %s on line %d float(0.1) @@ -151,13 +142,6 @@ array(1) { int(1) } } -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} Warning: Cannot use a scalar value as an array in %s on line %d float(0.1) @@ -193,13 +177,6 @@ array(1) { int(1) } } -array(1) { - [0]=> - &array(1) { - [0]=> - int(1) - } -} Warning: Cannot use a scalar value as an array in %s on line %d float(0.1) @@ -211,4 +188,4 @@ array(1) { } } -Done \ No newline at end of file +Done diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 178d2ebf3d3aa..42761204b93bd 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2323,31 +2323,25 @@ ZEND_VM_C_LABEL(try_assign_dim_array): zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, OP_DATA_TYPE, (opline+1)->op1, execute_data); FREE_OP2(); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (OP2_TYPE == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - FREE_UNFETCHED_OP_DATA(); - FREE_OP1_VAR_PTR(); - HANDLE_EXCEPTION(); - } else { - zend_long offset; - - dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - FREE_OP2(); - value = GET_OP_DATA_ZVAL_PTR_DEREF(BP_VAR_R); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - FREE_OP_DATA(); - } + if (OP2_TYPE == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + FREE_UNFETCHED_OP_DATA(); + FREE_OP1_VAR_PTR(); + HANDLE_EXCEPTION(); } else { - zval_ptr_dtor_nogc(object_ptr); -ZEND_VM_C_LABEL(assign_dim_convert_to_array): - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - ZEND_VM_C_GOTO(try_assign_dim_array); + zend_long offset; + + dim = GET_OP2_ZVAL_PTR(BP_VAR_R); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + FREE_OP2(); + value = GET_OP_DATA_ZVAL_PTR_DEREF(BP_VAR_R); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + FREE_OP_DATA(); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - ZEND_VM_C_GOTO(assign_dim_convert_to_array); + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + ZEND_VM_C_GOTO(try_assign_dim_array); } else if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { ZEND_VM_C_GOTO(assign_dim_clean); } else { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index e87f28e44df1b..8915d5205550a 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -18336,31 +18336,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -18432,31 +18426,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -18528,31 +18516,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -18624,31 +18606,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -20272,31 +20248,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -20368,31 +20338,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -20464,31 +20428,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -20560,31 +20518,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -22671,31 +22623,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -22767,31 +22713,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -22863,31 +22803,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -22959,31 +22893,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -25209,31 +25137,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -25305,31 +25227,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; - - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + zend_long offset; + + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -25401,31 +25317,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; - - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + zend_long offset; + + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -25497,31 +25407,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -37973,31 +37877,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -38069,31 +37967,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -38165,31 +38057,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -38261,31 +38147,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DA zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CONST == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CONST == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = EX_CONSTANT(opline->op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = EX_CONSTANT(opline->op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -41044,31 +40924,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -41140,31 +41014,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -41236,31 +41104,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -41332,31 +41194,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_UNUSED == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_UNUSED == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = NULL; - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = NULL; + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -44289,31 +44145,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -44385,31 +44235,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -44481,31 +44325,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -44577,31 +44415,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if (IS_CV == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if (IS_CV == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -47821,31 +47653,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CONST, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = EX_CONSTANT((opline+1)->op1); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = EX_CONSTANT((opline+1)->op1); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -47917,31 +47743,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_TMP_VAR, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - - HANDLE_EXCEPTION(); - } else { - zend_long offset; + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } + HANDLE_EXCEPTION(); } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + zend_long offset; + + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_tmp((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -48013,31 +47833,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_VAR, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); - zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); - HANDLE_EXCEPTION(); - } else { - zend_long offset; - - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - zval_ptr_dtor_nogc(free_op_data); - } + HANDLE_EXCEPTION(); } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; + zend_long offset; + + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_var_deref((opline+1)->op1.var, execute_data, &free_op_data); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + zval_ptr_dtor_nogc(free_op_data); } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else { @@ -48109,31 +47923,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_D zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, IS_CV, (opline+1)->op1, execute_data); zval_ptr_dtor_nogc(free_op2); } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { - if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { - if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_throw_error(NULL, "[] operator not supported for strings"); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_throw_error(NULL, "[] operator not supported for strings"); - HANDLE_EXCEPTION(); - } else { - zend_long offset; + HANDLE_EXCEPTION(); + } else { + zend_long offset; - dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); - zval_ptr_dtor_nogc(free_op2); - value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); - zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); + dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W); + zval_ptr_dtor_nogc(free_op2); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, (opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL)); - } - } else { - zval_ptr_dtor_nogc(object_ptr); -assign_dim_convert_to_array: - ZVAL_NEW_ARR(object_ptr); - zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); - goto try_assign_dim_array; } } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { - goto assign_dim_convert_to_array; + ZVAL_NEW_ARR(object_ptr); + zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0); + goto try_assign_dim_array; } else if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(object_ptr))) { goto assign_dim_clean; } else {