Skip to content

Commit

Permalink
Merge 2c3f68d into 4074bab
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant committed Feb 7, 2024
2 parents 4074bab + 2c3f68d commit 2aa3f16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,12 +994,14 @@ impl<'a> FunctionContext<'a> {
index: ValueId,
location: Location,
) -> ValueId {
let element_size = self.builder.field_constant(self.element_size(array));
let index = self.make_array_index(index);
let element_size =
self.builder.numeric_constant(self.element_size(array), Type::unsigned(64));

// The actual base index is the user's index * the array element type's size
let mut index =
self.builder.set_location(location).insert_binary(index, BinaryOp::Mul, element_size);
let one = self.builder.field_constant(FieldElement::one());
let one = self.builder.numeric_constant(FieldElement::one(), Type::unsigned(64));

new_value.for_each(|value| {
let value = value.eval(self);
Expand Down

0 comments on commit 2aa3f16

Please sign in to comment.