Commit 5963656
committed
Fix GH-21006: JIT SEGV with FETCH_OBJ_FUNC_ARG and property hooks
When the JIT falls back to the VM handler for FETCH_OBJ_FUNC_ARG (or
FETCH_OBJ_R), the handler may find the SIMPLE_GET flag set in the
runtime cache for a hooked property. This causes it to push a call
frame for the hook function, changing execute_data. When the trace
resumes after the handler returns, it continues with the wrong
execute_data, leading to a segfault on the next opcode that accesses
EX(call).
Fix by emitting IR code in zend_jit_trace_handler() to clear the
SIMPLE_GET flag in the runtime cache before calling the VM handler,
so it falls through to read_property instead.1 parent f99ca63 commit 5963656
2 files changed
+53
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17091 | 17091 | | |
17092 | 17092 | | |
17093 | 17093 | | |
| 17094 | + | |
| 17095 | + | |
| 17096 | + | |
| 17097 | + | |
| 17098 | + | |
| 17099 | + | |
| 17100 | + | |
| 17101 | + | |
| 17102 | + | |
| 17103 | + | |
| 17104 | + | |
| 17105 | + | |
| 17106 | + | |
| 17107 | + | |
| 17108 | + | |
17094 | 17109 | | |
17095 | 17110 | | |
17096 | 17111 | | |
| |||
| 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 | + | |
0 commit comments