Skip to content

Commit b88af78

Browse files
committed
Fix exception IP in JIT
1 parent ea02682 commit b88af78

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
688688
| .if ZTS
689689
|| if (GCC_GLOBAL_REGS) {
690690
| LOAD_TSRM_CACHE IP
691-
| MEM_ACCESS_64_WITH_UOFFSET ldr, IP, IP, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
691+
| ADD_SUB_64_WITH_CONST_32 add, IP, IP, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
692692
|| } else {
693693
| LOAD_TSRM_CACHE RX
694694
| ADD_SUB_64_WITH_CONST_32 add, RX, RX, (struct.._offset+offsetof(zend_..struct, field)), tmp_reg
@@ -1935,6 +1935,9 @@ static int zend_jit_leave_throw_stub(dasm_State **Dst)
19351935
|5:
19361936
| // opline = EG(exception_op);
19371937
| LOAD_IP_ADDR_ZTS executor_globals, exception_op, TMP2
1938+
|| if (ZEND_OBSERVER_ENABLED) {
1939+
| str IP, EX->opline
1940+
|| }
19381941
| // HANDLE_EXCEPTION()
19391942
| b ->exception_handler
19401943
} else {

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static size_t tsrm_tls_offset;
406406
| .if ZTS
407407
|| if (GCC_GLOBAL_REGS) {
408408
| LOAD_TSRM_CACHE IP
409-
| mov IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
409+
| lea IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
410410
|| } else {
411411
| LOAD_TSRM_CACHE RX
412412
| lea RX, aword [RX + (struct.._offset + offsetof(zend_..struct, field))]
@@ -1884,6 +1884,9 @@ static int zend_jit_leave_throw_stub(dasm_State **Dst)
18841884
|5:
18851885
| // opline = EG(exception_op);
18861886
| LOAD_IP_ADDR_ZTS executor_globals, exception_op
1887+
|| if (ZEND_OBSERVER_ENABLED) {
1888+
| mov aword EX->opline, IP
1889+
|| }
18871890
| // HANDLE_EXCEPTION()
18881891
| jmp ->exception_handler
18891892
} else {

0 commit comments

Comments
 (0)