@@ -4180,6 +4180,9 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, uint32_t op
4180
4180
4181
4181
exit_point = zend_jit_trace_get_exit_point(opline + 1, 0);
4182
4182
exit_addr = zend_jit_trace_get_exit_addr(exit_point);
4183
+ if (!exit_addr) {
4184
+ return 0;
4185
+ }
4183
4186
| jo &exit_addr
4184
4187
4185
4188
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
@@ -4479,6 +4482,9 @@ static int zend_jit_math_long_long(dasm_State **Dst,
4479
4482
if (res_info & MAY_BE_GUARD) {
4480
4483
int32_t exit_point = zend_jit_trace_get_exit_point(opline, 0);
4481
4484
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
4485
+ if (!exit_addr) {
4486
+ return 0;
4487
+ }
4482
4488
if ((res_info & MAY_BE_ANY) == MAY_BE_LONG) {
4483
4489
| jo &exit_addr
4484
4490
if (Z_MODE(res_addr) == IS_REG && result_reg != Z_REG(res_addr)) {
@@ -6866,6 +6872,9 @@ static int zend_jit_assign_dim_op(dasm_State **Dst, const zend_op *opline, uint3
6866
6872
&& !(op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING)))) {
6867
6873
int32_t exit_point = zend_jit_trace_get_exit_point(opline, 0);
6868
6874
not_found_exit_addr = zend_jit_trace_get_exit_addr(exit_point);
6875
+ if (!not_found_exit_addr) {
6876
+ return 0;
6877
+ }
6869
6878
}
6870
6879
6871
6880
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, BP_VAR_RW, op1_info, op2_info, dim_type, NULL, not_found_exit_addr, NULL)) {
@@ -13123,6 +13132,9 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
13123
13132
&& (op1_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_OBJECT) {
13124
13133
exit_point = zend_jit_trace_get_exit_point(opline, 0);
13125
13134
exit_addr = zend_jit_trace_get_exit_addr(exit_point);
13135
+ if (!exit_addr) {
13136
+ return 0;
13137
+ }
13126
13138
} else {
13127
13139
val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 0);
13128
13140
| LOAD_ZVAL_ADDR r0, prop_addr
@@ -13514,6 +13526,9 @@ static int zend_jit_incdec_obj(dasm_State **Dst,
13514
13526
if (use_prop_guard) {
13515
13527
int32_t exit_point = zend_jit_trace_get_exit_point(opline, 0);
13516
13528
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
13529
+ if (!exit_addr) {
13530
+ return 0;
13531
+ }
13517
13532
13518
13533
| IF_NOT_ZVAL_TYPE var_addr, prop_type, &exit_addr
13519
13534
var_info = (1 << prop_type) | (var_info & ~(MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF));
@@ -13672,6 +13687,9 @@ static int zend_jit_incdec_obj(dasm_State **Dst,
13672
13687
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_DOUBLE, 0);
13673
13688
exit_point = zend_jit_trace_get_exit_point(opline + 1, 0);
13674
13689
exit_addr = zend_jit_trace_get_exit_addr(exit_point);
13690
+ if (!exit_addr) {
13691
+ return 0;
13692
+ }
13675
13693
SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var), old_res_info);
13676
13694
ssa->var_info[ssa_op->result_def].type = res_info & ~MAY_BE_GUARD;
13677
13695
| jmp &exit_addr
@@ -13995,6 +14013,9 @@ static int zend_jit_assign_obj_op(dasm_State **Dst,
13995
14013
if (use_prop_guard) {
13996
14014
int32_t exit_point = zend_jit_trace_get_exit_point(opline, 0);
13997
14015
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
14016
+ if (!exit_addr) {
14017
+ return 0;
14018
+ }
13998
14019
13999
14020
| IF_NOT_ZVAL_TYPE var_addr, prop_type, &exit_addr
14000
14021
var_info = (1 << prop_type) | (var_info & ~(MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF));
@@ -14695,6 +14716,10 @@ static int zend_jit_fetch_this(dasm_State **Dst, const zend_op *opline, const ze
14695
14716
int32_t exit_point = zend_jit_trace_get_exit_point(opline, ZEND_JIT_EXIT_TO_VM);
14696
14717
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
14697
14718
14719
+ if (!exit_addr) {
14720
+ return 0;
14721
+ }
14722
+
14698
14723
| cmp byte EX->This.u1.v.type, IS_OBJECT
14699
14724
| jne &exit_addr
14700
14725
@@ -14876,10 +14901,16 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o
14876
14901
if (next_opline != opline + 1) {
14877
14902
exit_point = zend_jit_trace_get_exit_point(opline + 1, 0);
14878
14903
fallback_label = zend_jit_trace_get_exit_addr(exit_point);
14904
+ if (!fallback_label) {
14905
+ return 0;
14906
+ }
14879
14907
}
14880
14908
if (next_opline != default_opline) {
14881
14909
exit_point = zend_jit_trace_get_exit_point(default_opline, 0);
14882
14910
default_label = zend_jit_trace_get_exit_addr(exit_point);
14911
+ if (!default_label) {
14912
+ return 0;
14913
+ }
14883
14914
}
14884
14915
}
14885
14916
0 commit comments