Commit 0777c51
committed
Fix GH-21368 crash: resolve orig_handler at side-trace compile time
zend_jit_escape_if_undef read orig_handler via an op_array pointer
captured at parent-trace compile time. That pointer goes stale by the
time a side trace compiles for the exit, producing the access violation
reported by vibbow on PHP 8.5.5 Windows x64 NTS+FastCGI.
Resolve orig_handler against jit->current_op_array.
zend_jit_trace_start sets it to trace_buffer->op_array during side-trace
compilation; zend_jit_deoptimizer_start leaves it unset, so seed it
from exit_info->op_array in zend_jit_trace_exit_to_vm.
Create the IR ref via ir_CONST_FC_FUNC so jit->addr_hash registers the
handler as IR_FUNC_ADDR. A later ir_CONST_FC_FUNC for the same handler
otherwise trips the FUNC_ADDR assertion in jit_CONST_FUNC_PROTO. The
x86 ir_CAST_FC_FUNC becomes dead.1 parent 391ec27 commit 0777c51
2 files changed
Lines changed: 6 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 | | |
| |||
8094 | 8094 | | |
8095 | 8095 | | |
8096 | 8096 | | |
8097 | | - | |
| 8097 | + | |
8098 | 8098 | | |
8099 | | - | |
| 8099 | + | |
8100 | 8100 | | |
8101 | 8101 | | |
8102 | 8102 | | |
8103 | | - | |
8104 | | - | |
8105 | | - | |
8106 | 8103 | | |
8107 | 8104 | | |
8108 | 8105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
3606 | | - | |
| 3606 | + | |
3607 | 3607 | | |
3608 | 3608 | | |
3609 | 3609 | | |
| |||
7374 | 7374 | | |
7375 | 7375 | | |
7376 | 7376 | | |
| 7377 | + | |
| 7378 | + | |
7377 | 7379 | | |
7378 | 7380 | | |
7379 | 7381 | | |
| |||
0 commit comments