Skip to content

Commit 6f56cee

Browse files
committed
Passing values to FFI functions won't change their types
1 parent b077dcf commit 6f56cee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7189,6 +7189,18 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
71897189
|| opline->opcode == ZEND_FE_RESET_R) {
71907190
/* keep old value */
71917191
type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var));
7192+
#ifdef HAVE_FFI
7193+
} else if (JIT_G(current_frame)
7194+
&& JIT_G(current_frame)->call
7195+
&& TRACE_FRAME_FFI(JIT_G(current_frame)->call)
7196+
&& (opline->opcode == ZEND_SEND_VAR_EX
7197+
|| opline->opcode == ZEND_SEND_VAR_NO_REF
7198+
|| opline->opcode == ZEND_SEND_VAR_NO_REF_EX
7199+
|| opline->opcode == ZEND_SEND_FUNC_ARG)
7200+
&& opline->op2_type != IS_CONST) {
7201+
/* keep old value */
7202+
type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var));
7203+
#endif
71927204
}
71937205
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), type,
71947206
(gen_handler || type == IS_UNKNOWN || !ra ||

0 commit comments

Comments
 (0)