Commit 7b46b55
committed
Fix phpGH-21770: Infinite recursion in property hook getter in opcache preloaded trait
preload_fix_trait_op_array rewrites the clone op_array from its original
after optimization, preserving function_name, scope, fn_flags, prototype,
and static_variables. For trait-cloned property hooks, it also needs to
preserve prop_info: zend_do_traits_property_binding set it to the using
class's property, but the reset pointed it back at the trait's property.
That mismatch caused zend_is_in_hook to miss the self-access check inside
the hook, recursing into the getter/setter instead of reading or writing
the backing store.
Closes phpGH-217701 parent afded3d commit 7b46b55
File tree
3 files changed
+47
-0
lines changed- ext/opcache
- tests
3 files changed
+47
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4290 | 4290 | | |
4291 | 4291 | | |
4292 | 4292 | | |
| 4293 | + | |
4293 | 4294 | | |
4294 | 4295 | | |
4295 | 4296 | | |
4296 | 4297 | | |
4297 | 4298 | | |
4298 | 4299 | | |
| 4300 | + | |
4299 | 4301 | | |
4300 | 4302 | | |
4301 | 4303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments