Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ssa typing for assign_lvalue_index #4289

Merged
merged 1 commit into from
Feb 7, 2024
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
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
Loading