@@ -6288,10 +6288,19 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_
6288
6288
}
6289
6289
}
6290
6290
6291
+ #if ZEND_DEBUG
6292
+ /* For non-standard object handlers, verify a declared property type in debug builds.
6293
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
6294
+ zend_property_info *prop_info = NULL;
6295
+ if (zobj->handlers->read_property != zend_std_read_property) {
6296
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
6297
+ }
6298
+ #endif
6291
6299
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
6292
6300
#if ZEND_DEBUG
6293
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
6294
- zend_verify_internal_read_property_type(zobj, name, retval);
6301
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
6302
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
6303
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
6295
6304
}
6296
6305
#endif
6297
6306
@@ -8608,10 +8617,19 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_
8608
8617
}
8609
8618
}
8610
8619
8620
+ #if ZEND_DEBUG
8621
+ /* For non-standard object handlers, verify a declared property type in debug builds.
8622
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
8623
+ zend_property_info *prop_info = NULL;
8624
+ if (zobj->handlers->read_property != zend_std_read_property) {
8625
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
8626
+ }
8627
+ #endif
8611
8628
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
8612
8629
#if ZEND_DEBUG
8613
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
8614
- zend_verify_internal_read_property_type(zobj, name, retval);
8630
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
8631
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
8632
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
8615
8633
}
8616
8634
#endif
8617
8635
@@ -10963,10 +10981,19 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_
10963
10981
}
10964
10982
}
10965
10983
10984
+ #if ZEND_DEBUG
10985
+ /* For non-standard object handlers, verify a declared property type in debug builds.
10986
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
10987
+ zend_property_info *prop_info = NULL;
10988
+ if (zobj->handlers->read_property != zend_std_read_property) {
10989
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
10990
+ }
10991
+ #endif
10966
10992
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
10967
10993
#if ZEND_DEBUG
10968
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
10969
- zend_verify_internal_read_property_type(zobj, name, retval);
10994
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
10995
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
10996
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
10970
10997
}
10971
10998
#endif
10972
10999
@@ -15386,10 +15413,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_
15386
15413
}
15387
15414
}
15388
15415
15416
+ #if ZEND_DEBUG
15417
+ /* For non-standard object handlers, verify a declared property type in debug builds.
15418
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
15419
+ zend_property_info *prop_info = NULL;
15420
+ if (zobj->handlers->read_property != zend_std_read_property) {
15421
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
15422
+ }
15423
+ #endif
15389
15424
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
15390
15425
#if ZEND_DEBUG
15391
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
15392
- zend_verify_internal_read_property_type(zobj, name, retval);
15426
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
15427
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
15428
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
15393
15429
}
15394
15430
#endif
15395
15431
@@ -16809,10 +16845,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR
16809
16845
}
16810
16846
}
16811
16847
16848
+ #if ZEND_DEBUG
16849
+ /* For non-standard object handlers, verify a declared property type in debug builds.
16850
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
16851
+ zend_property_info *prop_info = NULL;
16852
+ if (zobj->handlers->read_property != zend_std_read_property) {
16853
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
16854
+ }
16855
+ #endif
16812
16856
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
16813
16857
#if ZEND_DEBUG
16814
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
16815
- zend_verify_internal_read_property_type(zobj, name, retval);
16858
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
16859
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
16860
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
16816
16861
}
16817
16862
#endif
16818
16863
@@ -18124,10 +18169,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HAN
18124
18169
}
18125
18170
}
18126
18171
18172
+ #if ZEND_DEBUG
18173
+ /* For non-standard object handlers, verify a declared property type in debug builds.
18174
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
18175
+ zend_property_info *prop_info = NULL;
18176
+ if (zobj->handlers->read_property != zend_std_read_property) {
18177
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
18178
+ }
18179
+ #endif
18127
18180
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
18128
18181
#if ZEND_DEBUG
18129
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
18130
- zend_verify_internal_read_property_type(zobj, name, retval);
18182
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
18183
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
18184
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
18131
18185
}
18132
18186
#endif
18133
18187
@@ -31428,10 +31482,19 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R
31428
31482
}
31429
31483
}
31430
31484
31485
+ #if ZEND_DEBUG
31486
+ /* For non-standard object handlers, verify a declared property type in debug builds.
31487
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
31488
+ zend_property_info *prop_info = NULL;
31489
+ if (zobj->handlers->read_property != zend_std_read_property) {
31490
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
31491
+ }
31492
+ #endif
31431
31493
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
31432
31494
#if ZEND_DEBUG
31433
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
31434
- zend_verify_internal_read_property_type(zobj, name, retval);
31495
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
31496
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
31497
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
31435
31498
}
31436
31499
#endif
31437
31500
@@ -33286,10 +33349,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR
33286
33349
}
33287
33350
}
33288
33351
33352
+ #if ZEND_DEBUG
33353
+ /* For non-standard object handlers, verify a declared property type in debug builds.
33354
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
33355
+ zend_property_info *prop_info = NULL;
33356
+ if (zobj->handlers->read_property != zend_std_read_property) {
33357
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
33358
+ }
33359
+ #endif
33289
33360
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
33290
33361
#if ZEND_DEBUG
33291
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
33292
- zend_verify_internal_read_property_type(zobj, name, retval);
33362
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
33363
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
33364
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
33293
33365
}
33294
33366
#endif
33295
33367
@@ -35756,10 +35828,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN
35756
35828
}
35757
35829
}
35758
35830
35831
+ #if ZEND_DEBUG
35832
+ /* For non-standard object handlers, verify a declared property type in debug builds.
35833
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
35834
+ zend_property_info *prop_info = NULL;
35835
+ if (zobj->handlers->read_property != zend_std_read_property) {
35836
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
35837
+ }
35838
+ #endif
35759
35839
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
35760
35840
#if ZEND_DEBUG
35761
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
35762
- zend_verify_internal_read_property_type(zobj, name, retval);
35841
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
35842
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
35843
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
35763
35844
}
35764
35845
#endif
35765
35846
@@ -39895,10 +39976,19 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R
39895
39976
}
39896
39977
}
39897
39978
39979
+ #if ZEND_DEBUG
39980
+ /* For non-standard object handlers, verify a declared property type in debug builds.
39981
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
39982
+ zend_property_info *prop_info = NULL;
39983
+ if (zobj->handlers->read_property != zend_std_read_property) {
39984
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
39985
+ }
39986
+ #endif
39898
39987
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
39899
39988
#if ZEND_DEBUG
39900
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
39901
- zend_verify_internal_read_property_type(zobj, name, retval);
39989
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
39990
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
39991
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
39902
39992
}
39903
39993
#endif
39904
39994
@@ -43531,10 +43621,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN
43531
43621
}
43532
43622
}
43533
43623
43624
+ #if ZEND_DEBUG
43625
+ /* For non-standard object handlers, verify a declared property type in debug builds.
43626
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
43627
+ zend_property_info *prop_info = NULL;
43628
+ if (zobj->handlers->read_property != zend_std_read_property) {
43629
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
43630
+ }
43631
+ #endif
43534
43632
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
43535
43633
#if ZEND_DEBUG
43536
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
43537
- zend_verify_internal_read_property_type(zobj, name, retval);
43634
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
43635
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
43636
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
43538
43637
}
43539
43638
#endif
43540
43639
@@ -48562,10 +48661,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER
48562
48661
}
48563
48662
}
48564
48663
48664
+ #if ZEND_DEBUG
48665
+ /* For non-standard object handlers, verify a declared property type in debug builds.
48666
+ * Fetch prop_info before calling read_property(), as it may deallocate the object. */
48667
+ zend_property_info *prop_info = NULL;
48668
+ if (zobj->handlers->read_property != zend_std_read_property) {
48669
+ prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true);
48670
+ }
48671
+ #endif
48565
48672
retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var));
48566
48673
#if ZEND_DEBUG
48567
- if (!EG(exception) && zobj->handlers->read_property != zend_std_read_property) {
48568
- zend_verify_internal_read_property_type(zobj, name, retval);
48674
+ if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
48675
+ && ZEND_TYPE_IS_SET(prop_info->type)) {
48676
+ zend_verify_property_type(prop_info, retval, /* strict */ true);
48569
48677
}
48570
48678
#endif
48571
48679
0 commit comments