Skip to content

Commit 1254aa4

Browse files
committed
Avoid setting ce for ref return_info
This is unlikely to matter in practice (due to short lifetime), but necessary to satisfy the SSA integrity check. Fixes oss-fuzz #46980.
1 parent ab1d5a9 commit 1254aa4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4053,6 +4053,8 @@ uint32_t zend_get_return_info_from_signature_only(
40534053
if ((func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
40544054
&& !(func->common.fn_flags & ZEND_ACC_GENERATOR)) {
40554055
type |= MAY_BE_REF;
4056+
*ce = NULL;
4057+
*ce_is_instanceof = 0;
40564058
}
40574059
return type;
40584060
}
@@ -4136,7 +4138,7 @@ static void zend_func_return_info(const zend_op_array *op_array,
41364138
tmp |= t1;
41374139

41384140
if (ssa_op && info->ssa.var_info &&
4139-
ssa_op->op1_use >= 0 &&
4141+
ssa_op->op1_use >= 0 && !(t1 & MAY_BE_REF) &&
41404142
info->ssa.var_info[ssa_op->op1_use].ce) {
41414143
arg_ce = info->ssa.var_info[ssa_op->op1_use].ce;
41424144
arg_is_instanceof = info->ssa.var_info[ssa_op->op1_use].is_instanceof;

0 commit comments

Comments
 (0)