Skip to content

Commit

Permalink
fix: preserve types when reading from calldata arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jan 22, 2025
1 parent a1cf830 commit 179b7e7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/acir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ impl<'a> Context<'a> {
typ: &Type,
) -> Result<AcirValue, RuntimeError> {
match typ {
Type::Numeric(_) => self.array_get_value(&Type::field(), call_data_block, offset),
Type::Numeric(_) => self.array_get_value(typ, call_data_block, offset),
Type::Array(arc, len) => {
let mut result = im::Vector::new();
for _i in 0..*len {
Expand Down
6 changes: 6 additions & 0 deletions test_programs/execution_success/regression_7143/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "regression_7143"
type = "bin"
authors = [""]

[dependencies]
3 changes: 3 additions & 0 deletions test_programs/execution_success/regression_7143/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
array = [0]
x = 0
return = 1
3 changes: 3 additions & 0 deletions test_programs/execution_success/regression_7143/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main(x: u32, array: call_data(0) [bool; 1]) -> pub bool {
!array[x]
}

0 comments on commit 179b7e7

Please sign in to comment.