Skip to content

Commit fbd8e20

Browse files
committed
Observe unused return values in JIT
Even if the return value is not used, it should still be available to the observer.
1 parent dd7d829 commit fbd8e20

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11431,6 +11431,13 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
1143111431
return_value_used = -1;
1143211432
}
1143311433

11434+
if (ZEND_OBSERVER_ENABLED) {
11435+
| LOAD_ZVAL_ADDR FCARG2a, op1_addr
11436+
| mov FCARG1a, FP
11437+
| SET_EX_OPLINE opline, r0
11438+
| EXT_CALL zend_observer_fcall_end, r0
11439+
}
11440+
1143411441
// if (!EX(return_value))
1143511442
if (Z_MODE(op1_addr) == IS_REG && Z_REG(op1_addr) == ZREG_R1) {
1143611443
if (return_value_used != 0) {
@@ -11497,12 +11504,6 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
1149711504

1149811505
if (return_value_used == 0) {
1149911506
|9:
11500-
if (ZEND_OBSERVER_ENABLED) {
11501-
| xor FCARG2a, FCARG2a
11502-
| mov FCARG1a, FP
11503-
| SET_EX_OPLINE opline, r0
11504-
| EXT_CALL zend_observer_fcall_end, r0
11505-
}
1150611507
return 1;
1150711508
}
1150811509

@@ -11571,12 +11572,6 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
1157111572
}
1157211573

1157311574
|9:
11574-
if (ZEND_OBSERVER_ENABLED) {
11575-
| LOAD_ZVAL_ADDR FCARG2a, ret_addr
11576-
| mov FCARG1a, FP
11577-
| SET_EX_OPLINE opline, r0
11578-
| EXT_CALL zend_observer_fcall_end, r0
11579-
}
1158011575
return 1;
1158111576
}
1158211577

0 commit comments

Comments
 (0)