Skip to content

Commit 7645265

Browse files
committed
Fixed incorrect error message
1 parent 3c37a34 commit 7645265

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ static ZEND_COLD void undef_result_after_exception() {
2727
}
2828
}
2929

30+
static ZEND_COLD void zend_jit_illegal_offset(void)
31+
{
32+
zend_type_error("Illegal offset type");
33+
}
34+
3035
static ZEND_COLD void zend_jit_illegal_string_offset(zval *offset)
3136
{
3237
zend_type_error("Cannot access offset of type %s on string", zend_zval_type_name(offset));
3338
}
3439

35-
3640
static zend_never_inline zend_function* ZEND_FASTCALL _zend_jit_init_func_run_time_cache(const zend_op_array *op_array) /* {{{ */
3741
{
3842
void **run_time_cache;
@@ -408,7 +412,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim,
408412
hval = 1;
409413
goto num_index;
410414
default:
411-
zend_jit_illegal_string_offset(dim);
415+
zend_jit_illegal_offset();
412416
undef_result_after_exception();
413417
return;
414418
}
@@ -473,7 +477,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim
473477
hval = 1;
474478
goto num_index;
475479
default:
476-
zend_jit_illegal_string_offset(dim);
480+
zend_jit_illegal_offset();
477481
undef_result_after_exception();
478482
return;
479483
}
@@ -603,7 +607,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
603607
hval = 1;
604608
goto num_index;
605609
default:
606-
zend_jit_illegal_string_offset(dim);
610+
zend_jit_illegal_offset();
607611
undef_result_after_exception();
608612
return NULL;
609613
}
@@ -676,7 +680,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
676680
hval = 1;
677681
goto num_index;
678682
default:
679-
zend_jit_illegal_string_offset(dim);
683+
zend_jit_illegal_offset();
680684
undef_result_after_exception();
681685
return NULL;
682686
}

0 commit comments

Comments
 (0)