Commit 275f490
committed
deepclone_hydrate: skip null→uninit shortcut on lazy objects
The shortcut sets IS_PROP_UNINIT on OBJ_PROP(obj, pi->offset) directly.
On a lazy object with NO_LAZY_INIT set, the entry to dc_write_backed_property
doesn't route through zend_update_property_ex, and the shortcut would fire
before the Reflection-based lazy path at the bottom of the function — so a
null value for a non-nullable typed prop on a lazy object could end up
mutating the slot while the lazy-props counter and IS_PROP_LAZY flags
remained in their pre-write state.
Gating the shortcut on zend_lazy_object_initialized(obj) lets the Reflection
path handle lazy objects consistently (it will TypeError on null for a
non-nullable prop, matching what a real write would do).1 parent 59777e8 commit 275f490
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
757 | 760 | | |
758 | 761 | | |
759 | 762 | | |
760 | | - | |
761 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
762 | 768 | | |
763 | 769 | | |
764 | 770 | | |
| |||
0 commit comments