Skip to content

Commit f767807

Browse files
committed
Result of ASSIGN may be different from the assigned value when LHS is a typed reference
1 parent a8e8c40 commit f767807

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
27112711
type = STACK_VAR_TYPE(opline->op1.var);
27122712
}
27132713
} else if (opline->opcode == ZEND_ASSIGN) {
2714-
if (opline->op2_type != IS_CONST) {
2714+
if (opline->op2_type != IS_CONST
2715+
&& ssa_op->op1_use >= 0
2716+
/* assignment to typed reference may cause conversion */
2717+
&& (ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF) == 0) {
27152718
/* copy */
27162719
type = STACK_VAR_TYPE(opline->op2.var);
27172720
}

0 commit comments

Comments
 (0)