Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions compiler/noirc_frontend/src/ownership/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ impl Context {
}
Expression::ExtractTupleField(tuple, _index) => self.handle_reference_expression(tuple),

Expression::Index(index) => {
self.handle_reference_expression(&mut index.collection);
self.handle_expression(&mut index.index);
}

// If we have something like `f(arg)` then we want to treat those variables normally
// rather than avoid cloning them. So we shouldn't recur in `handle_reference_expression`.
other => self.handle_expression(other),
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions tooling/ssa_fuzzer/fuzzer/src/fuzz_lib/block_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,6 @@ impl BlockContext {
predicate,
);
assert_eq!(
<<<<<<< HEAD
result.value_id,
brillig_builder
.ecdsa_secp256r1(
Expand All @@ -845,15 +844,6 @@ impl BlockContext {
&mut self.stored_variables,
&result.to_value_type(),
result.clone(),
=======
result,
brillig_builder.ecdsa_secp256r1(
prepared_signature.public_key_x,
prepared_signature.public_key_y,
prepared_signature.hash,
prepared_signature.signature,
)
>>>>>>> master
);
self.store_variable(&result);
}
Expand Down Expand Up @@ -884,7 +874,6 @@ impl BlockContext {
predicate,
);
assert_eq!(
<<<<<<< HEAD
result.value_id,
brillig_builder
.ecdsa_secp256k1(
Expand All @@ -900,15 +889,6 @@ impl BlockContext {
&mut self.stored_variables,
&result.to_value_type(),
result.clone(),
=======
result,
brillig_builder.ecdsa_secp256k1(
prepared_signature.public_key_x,
prepared_signature.public_key_y,
prepared_signature.hash,
prepared_signature.signature,
)
>>>>>>> master
);
self.store_variable(&result);
}
Expand Down
51 changes: 0 additions & 51 deletions tooling/ssa_fuzzer/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,13 +781,8 @@ impl FuzzerBuilder {
let predicate = self.builder.numeric_constant(1_u32, NumericType::Unsigned { bit_size: 1 });
let result = self.builder.insert_call(
intrinsic,
<<<<<<< HEAD
vec![basic_point, scalar_id, predicate],
vec![return_type.clone()],
=======
vec![basic_point, scalar_id],
vec![return_type.clone().into()],
>>>>>>> master
);
assert_eq!(result.len(), 1);
let result = result[0];
Expand Down Expand Up @@ -838,16 +833,10 @@ impl FuzzerBuilder {
for scalar in &scalars {
assert!(scalar.validate());
}
<<<<<<< HEAD
let predicate =
self.builder.numeric_constant(predicate as u32, NumericType::Unsigned { bit_size: 1 });
let field_type = Type::Numeric(NumericType::NativeField);
let boolean_type = Type::Numeric(NumericType::Unsigned { bit_size: 1 });
=======

let field_type = Type::Numeric(NumericType::Field);
let boolean_type = Type::Numeric(NumericType::Boolean);
>>>>>>> master
let intrinsic = self
.builder
.import_intrinsic("multi_scalar_mul")
Expand Down Expand Up @@ -878,13 +867,8 @@ impl FuzzerBuilder {
);
let result = self.builder.insert_call(
intrinsic,
<<<<<<< HEAD
vec![point_ids_array, scalar_ids_array, predicate],
vec![return_type.clone()],
=======
vec![point_ids_array, scalar_ids_array],
vec![return_type.clone().into()],
>>>>>>> master
);
assert_eq!(result.len(), 1);
let result = result[0];
Expand Down Expand Up @@ -919,15 +903,10 @@ impl FuzzerBuilder {
pub fn point_add(&mut self, p1: Point, p2: Point, predicate: bool) -> Point {
assert!(p1.validate());
assert!(p2.validate());
<<<<<<< HEAD
let field_type = Type::Numeric(NumericType::NativeField);
let boolean_type = Type::Numeric(NumericType::Unsigned { bit_size: 1 });
let predicate =
self.builder.numeric_constant(predicate as u32, NumericType::Unsigned { bit_size: 1 });
=======
let field_type = Type::Numeric(NumericType::Field);
let boolean_type = Type::Numeric(NumericType::Boolean);
>>>>>>> master
let intrinsic = self
.builder
.import_intrinsic("embedded_curve_add")
Expand All @@ -938,12 +917,7 @@ impl FuzzerBuilder {
Arc::new(vec![field_type.clone(), field_type.clone(), boolean_type.clone()]),
1,
);
<<<<<<< HEAD
let result = self.builder.insert_call(intrinsic, arguments, vec![return_type.clone()]);
=======
let result =
self.builder.insert_call(intrinsic, points_flattened, vec![return_type.clone().into()]);
>>>>>>> master
assert_eq!(result.len(), 1);
let result = result[0];
let x_idx = self.builder.numeric_constant(0_u32, NumericType::U32.into());
Expand Down Expand Up @@ -987,21 +961,6 @@ impl FuzzerBuilder {
)
}

<<<<<<< HEAD
=======
fn bytes_to_ssa_slice(&mut self, vec: Vec<u8>) -> TypedValue {
let elements: Vec<Id<Value>> = vec
.into_iter()
.map(|x| self.builder.numeric_constant(x as u32, NumericType::U8.into()))
.collect();
let slice_type = Type::Slice(Arc::new(vec![Type::Numeric(NumericType::U8)]));
TypedValue::new(
self.builder.insert_make_array(elements.into(), slice_type.clone().into()),
slice_type,
)
}

>>>>>>> master
pub fn ecdsa_secp256r1(
&mut self,
pub_key_x: Vec<u8>,
Expand All @@ -1023,7 +982,6 @@ impl FuzzerBuilder {
.expect("ecdsa_secp256r1 intrinsic should be available");
let result = self.builder.insert_call(
intrinsic,
<<<<<<< HEAD
vec![
pub_key_x.value_id,
pub_key_y.value_id,
Expand All @@ -1032,10 +990,6 @@ impl FuzzerBuilder {
predicate,
],
vec![return_type.clone()],
=======
vec![pub_key_x.value_id, pub_key_y.value_id, signature.value_id, hash.value_id],
vec![return_type.clone().into()],
>>>>>>> master
);
assert_eq!(result.len(), 1);
let result = result[0];
Expand Down Expand Up @@ -1063,7 +1017,6 @@ impl FuzzerBuilder {
.expect("ecdsa_secp256k1 intrinsic should be available");
let result = self.builder.insert_call(
intrinsic,
<<<<<<< HEAD
vec![
pub_key_x.value_id,
pub_key_y.value_id,
Expand All @@ -1072,10 +1025,6 @@ impl FuzzerBuilder {
predicate,
],
vec![return_type.clone()],
=======
vec![pub_key_x.value_id, pub_key_y.value_id, signature.value_id, hash.value_id],
vec![return_type.clone().into()],
>>>>>>> master
);
assert_eq!(result.len(), 1);
let result = result[0];
Expand Down
Loading