Skip to content

Commit bcd43d4

Browse files
committed
Add JIT support
Move handling of false to the slow path.
1 parent ca0d034 commit bcd43d4

File tree

9 files changed

+327
-146
lines changed

9 files changed

+327
-146
lines changed

Zend/zend_execute.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_functi
15831583
}
15841584
}
15851585

1586+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void)
1587+
{
1588+
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
1589+
}
1590+
15861591
static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, zval *value OPLINE_DC EXECUTE_DATA_DC)
15871592
{
15881593
zend_uchar c;
@@ -2331,7 +2336,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
23312336
ZVAL_UNDEFINED_OP1();
23322337
}
23332338
if (Z_TYPE_P(container) == IS_FALSE) {
2334-
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
2339+
zend_false_to_array_deprecated();
23352340
}
23362341
if (type != BP_VAR_UNSET) {
23372342
array_init(container);

Zend/zend_execute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ extern ZEND_API const zend_internal_function zend_pass_function;
5858

5959
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data);
6060
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
61+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void);
6162
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
6263

6364
ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict);

Zend/zend_vm_def.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
12111211
ZVAL_UNDEFINED_OP1();
12121212
}
12131213
if (Z_TYPE_P(container) == IS_FALSE) {
1214-
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
1214+
zend_false_to_array_deprecated();
12151215
}
12161216
ZVAL_ARR(container, zend_new_array(8));
12171217
ZEND_VM_C_GOTO(assign_dim_op_new_array);
@@ -2594,7 +2594,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
25942594
}
25952595
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
25962596
if (Z_TYPE_P(object_ptr) == IS_FALSE) {
2597-
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
2597+
zend_false_to_array_deprecated();
25982598
}
25992599

26002600
if (Z_ISREF_P(orig_object_ptr)
@@ -6461,7 +6461,7 @@ ZEND_VM_C_LABEL(num_index_dim):
64616461
} else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) {
64626462
zend_throw_error(NULL, "Cannot unset offset in a non-array variable");
64636463
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) {
6464-
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
6464+
zend_false_to_array_deprecated();
64656465
}
64666466
} while (0);
64676467

0 commit comments

Comments
 (0)