Skip to content

Commit f73dc9a

Browse files
authored
fix: preserve types when reading from calldata arrays (#7144)
1 parent a1cf830 commit f73dc9a

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

compiler/noirc_evaluator/src/acir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ impl<'a> Context<'a> {
13341334
typ: &Type,
13351335
) -> Result<AcirValue, RuntimeError> {
13361336
match typ {
1337-
Type::Numeric(_) => self.array_get_value(&Type::field(), call_data_block, offset),
1337+
Type::Numeric(_) => self.array_get_value(typ, call_data_block, offset),
13381338
Type::Array(arc, len) => {
13391339
let mut result = im::Vector::new();
13401340
for _i in 0..*len {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "regression_7143"
3+
type = "bin"
4+
authors = [""]
5+
6+
[dependencies]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
array = [0]
2+
x = 0
3+
return = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main(x: u32, array: call_data(0) [bool; 1]) -> pub bool {
2+
!array[x]
3+
}

0 commit comments

Comments
 (0)