Commit 4c71cf2
committed
Fix GH-21368 crash: runtime lookup for orig_handler in escape_if_undef
PR #21368 replaced the trace_escape stub dispatch in zend_jit_escape_if_undef
with a compile-time constant load of orig_handler, computed from the exit
info's op_array pointer. That pointer can be NULL (when current_frame is
NULL at exit-point creation) or stale (when the underlying op_array is
freed before the side trace compiles), producing an access violation
inside zend_jit_escape_if_undef. Reported on PHP 8.5.5 Windows NTS.
Drop the op_array parameter and emit a runtime lookup via
zend_jit_orig_opline_handler() instead. That helper resolves the
jit_extension through EX(func) at dispatch time, which is valid
regardless of the compile-time op_array state. The gh21267 tests
still pass, confirming the infinite-loop fix is preserved.1 parent 391ec27 commit 4c71cf2
2 files changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8068 | 8068 | | |
8069 | 8069 | | |
8070 | 8070 | | |
8071 | | - | |
| 8071 | + | |
8072 | 8072 | | |
8073 | 8073 | | |
8074 | 8074 | | |
| |||
8092 | 8092 | | |
8093 | 8093 | | |
8094 | 8094 | | |
8095 | | - | |
8096 | | - | |
8097 | | - | |
8098 | | - | |
8099 | | - | |
| 8095 | + | |
| 8096 | + | |
| 8097 | + | |
| 8098 | + | |
| 8099 | + | |
| 8100 | + | |
8100 | 8101 | | |
8101 | 8102 | | |
8102 | 8103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
3606 | | - | |
| 3606 | + | |
3607 | 3607 | | |
3608 | 3608 | | |
3609 | 3609 | | |
| |||
0 commit comments