Repository navigation
Commit 30c6bd9
committed
Fix tracing JIT taking the wrong branch after a VM interrupt
zend_jit_trace_handler() runs some opcodes, such as COALESCE, through their
VM handler and stores the returned opline in IP. When the handler takes a
jump while an interrupt is pending, zend_interrupt_helper runs the interrupt
function and returns the jump target with ZEND_VM_ENTER_BIT set. The opline
guard after the handler then fails, and the trace exits to the fall-through
branch, so e.g. `$arr[$k] ?? 'default'` returns the default although the key
exists.
Clear ZEND_VM_ENTER_BIT when an interrupt function is installed, as
zend_jit_handler() already does for the function JIT. Only the CALL and
TAILCALL VMs are affected.1 parent c30231c commit 30c6bd9
3 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17228 | 17228 | | |
17229 | 17229 | | |
17230 | 17230 | | |
| 17231 | + | |
| 17232 | + | |
| 17233 | + | |
| 17234 | + | |
| 17235 | + | |
| 17236 | + | |
| 17237 | + | |
17231 | 17238 | | |
17232 | 17239 | | |
17233 | 17240 | | |
| |||
| 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments