Skip to content

Commit 329d38c

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: [Observer+JIT] Save opline before calling begin/end handlers
2 parents a15d215 + 11c4821 commit 329d38c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_trace_c
315315
}
316316
#ifdef HAVE_GCC_GLOBAL_REGS
317317
execute_data = EG(current_execute_data);
318-
opline = EX(opline);
318+
opline = execute_data ? EX(opline) : NULL;
319319
return;
320320
#else
321321
return 1;

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9841,6 +9841,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
98419841
if (!trace && op_array == &func->op_array) {
98429842
/* recursive call */
98439843
if (ZEND_OBSERVER_ENABLED) {
9844+
| SAVE_IP
98449845
| mov FCARG1a, FP
98459846
| EXT_CALL zend_observer_fcall_begin, r0
98469847
}
@@ -9950,6 +9951,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
99509951
}
99519952

99529953
if (ZEND_OBSERVER_ENABLED) {
9954+
| SAVE_IP
99539955
| mov FCARG1a, FP
99549956
| EXT_CALL zend_observer_fcall_begin, r0
99559957
}
@@ -11364,6 +11366,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
1136411366
if (ZEND_OBSERVER_ENABLED) {
1136511367
| xor FCARG2a, FCARG2a
1136611368
| mov FCARG1a, FP
11369+
| SET_EX_OPLINE opline, r0
1136711370
| EXT_CALL zend_observer_fcall_end, r0
1136811371
}
1136911372
return 1;
@@ -11437,6 +11440,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
1143711440
if (ZEND_OBSERVER_ENABLED) {
1143811441
| LOAD_ZVAL_ADDR FCARG2a, ret_addr
1143911442
| mov FCARG1a, FP
11443+
| SET_EX_OPLINE opline, r0
1144011444
| EXT_CALL zend_observer_fcall_end, r0
1144111445
}
1144211446
return 1;

0 commit comments

Comments
 (0)