Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,12 @@ impl<W: Write> Interpreter<'_, W> {
}
Intrinsic::ArrayRefCount | Intrinsic::SliceRefCount => {
let array = self.lookup_array_or_slice(args[0], "array/slice ref count")?;
let rc = *array.rc.borrow();
let mut rc = *array.rc.borrow();
// ACIR always returns 0 for the refcounts, and we expect that IncRc and DecRc don't appear in constrained SSA.
// The interpreter starts with a default ref-count value of 1. If it did not change, treat it as zero to match ACIR.
if !self.in_unconstrained_context() && rc == 1 {
rc = 0;
}
Ok(vec![Value::from_constant(rc.into(), NumericType::unsigned(32))?])
}
}
Expand Down
Loading