Skip to content

Fix exception IP in JIT #13929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
| .if ZTS
|| if (GCC_GLOBAL_REGS) {
| LOAD_TSRM_CACHE IP
| MEM_ACCESS_64_WITH_UOFFSET ldr, IP, IP, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
| ADD_SUB_64_WITH_CONST_32 add, IP, IP, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
|| } else {
| LOAD_TSRM_CACHE RX
| ADD_SUB_64_WITH_CONST_32 add, RX, RX, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
Expand Down Expand Up @@ -1935,6 +1935,7 @@ static int zend_jit_leave_throw_stub(dasm_State **Dst)
|5:
| // opline = EG(exception_op);
| LOAD_IP_ADDR_ZTS executor_globals, exception_op, TMP2
| str IP, EX->opline
| // HANDLE_EXCEPTION()
| b ->exception_handler
} else {
Expand Down
3 changes: 2 additions & 1 deletion ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static size_t tsrm_tls_offset;
| .if ZTS
|| if (GCC_GLOBAL_REGS) {
| LOAD_TSRM_CACHE IP
| mov IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
| lea IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is right!

|| } else {
| LOAD_TSRM_CACHE RX
| lea RX, aword [RX + (struct.._offset + offsetof(zend_..struct, field))]
Expand Down Expand Up @@ -1884,6 +1884,7 @@ static int zend_jit_leave_throw_stub(dasm_State **Dst)
|5:
| // opline = EG(exception_op);
| LOAD_IP_ADDR_ZTS executor_globals, exception_op
| mov aword EX->opline, IP
| // HANDLE_EXCEPTION()
| jmp ->exception_handler
} else {
Expand Down