Skip to content

Commit 2706615

Browse files
committed
Fixed retutn type inference when return undefined variable
1 parent 520a403 commit 2706615

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,10 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
14691469
} else {
14701470
ZEND_ASSERT(ssa_ops[idx].op1_use >= 0);
14711471
return_value_info = ssa_var_info[ssa_ops[idx].op1_use];
1472+
if (return_value_info.type & MAY_BE_UNDEF) {
1473+
return_value_info.type &= ~MAY_BE_UNDEF;
1474+
return_value_info.type |= MAY_BE_NULL;
1475+
}
14721476
return_value_info.type &= ~MAY_BE_GUARD;
14731477
}
14741478
break;

0 commit comments

Comments
 (0)