@@ -11830,7 +11830,6 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
11830
11830
| mov FCARG1x, TMP1
11831
11831
prop_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1x, 0);
11832
11832
if (opline->opcode == ZEND_FETCH_OBJ_W
11833
- && (opline->extended_value & ZEND_FETCH_OBJ_FLAGS)
11834
11833
&& (!ce || ce_is_instanceof || (ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS))) {
11835
11834
uint32_t flags = opline->extended_value & ZEND_FETCH_OBJ_FLAGS;
11836
11835
@@ -11839,6 +11838,14 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
11839
11838
| cbnz FCARG2x, >1
11840
11839
|.cold_code
11841
11840
|1:
11841
+ | ldr TMP1w, [FCARG2x, #offsetof(zend_property_info, flags)]
11842
+ | tst TMP1w, #ZEND_ACC_READONLY
11843
+ | bne >2
11844
+ | IF_TYPE REG2w, IS_OBJECT, >2
11845
+ | mov FCARG1x, FCARG2x
11846
+ | EXT_CALL zend_readonly_property_modification_error, REG0
11847
+ | b >9
11848
+ |2:
11842
11849
if (flags == ZEND_FETCH_DIM_WRITE) {
11843
11850
| SET_EX_OPLINE opline, REG0
11844
11851
| EXT_CALL zend_jit_check_array_promotion, REG0
@@ -11848,7 +11855,7 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
11848
11855
| EXT_CALL zend_jit_create_typed_ref, REG0
11849
11856
| b >9
11850
11857
} else {
11851
- ZEND_UNREACHABLE( );
11858
+ ZEND_ASSERT(flags == 0 );
11852
11859
}
11853
11860
|.code
11854
11861
}
@@ -11869,6 +11876,15 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
11869
11876
} else {
11870
11877
| IF_UNDEF REG2w, >5
11871
11878
}
11879
+ if (opline->opcode == ZEND_FETCH_OBJ_W && (prop_info->flags & ZEND_ACC_READONLY)) {
11880
+ | IF_NOT_TYPE REG2w, IS_OBJECT, >4
11881
+ |.cold_code
11882
+ |4:
11883
+ | LOAD_ADDR FCARG1x, prop_info
11884
+ | EXT_CALL zend_readonly_property_modification_error, REG0
11885
+ | b >9
11886
+ |.code
11887
+ }
11872
11888
if (opline->opcode == ZEND_FETCH_OBJ_W
11873
11889
&& (opline->extended_value & ZEND_FETCH_OBJ_FLAGS)
11874
11890
&& ZEND_TYPE_IS_SET(prop_info->type)) {
@@ -12895,7 +12911,7 @@ static int zend_jit_assign_obj(dasm_State **Dst,
12895
12911
}
12896
12912
} else {
12897
12913
prop_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1x, prop_info->offset);
12898
- if (!ce || ce_is_instanceof || !(ce->ce_flags & ZEND_ACC_IMMUTABLE) || ce->__get || ce->__set) {
12914
+ if (!ce || ce_is_instanceof || !(ce->ce_flags & ZEND_ACC_IMMUTABLE) || ce->__get || ce->__set || (prop_info->flags & ZEND_ACC_READONLY) ) {
12899
12915
// Undefined property with magic __get()/__set()
12900
12916
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
12901
12917
int32_t exit_point = zend_jit_trace_get_exit_point(opline, ZEND_JIT_EXIT_TO_VM);
0 commit comments