Skip to content

Commit 04c89d2

Browse files
authored
fix(brillig_gen): Pass correct size of complex types input for brillig foreign calls (#1922)
fix size of HeapArray passed to brillig foreign calls
1 parent 4969da7 commit 04c89d2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

crates/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,10 @@ impl<'block> BrilligBlock<'block> {
471471
let typ = dfg[value_id].get_type();
472472
match typ {
473473
Type::Numeric(_) => RegisterOrMemory::RegisterIndex(register_index),
474-
Type::Array(_, size) => {
475-
RegisterOrMemory::HeapArray(HeapArray { pointer: register_index, size })
476-
}
474+
Type::Array(..) => RegisterOrMemory::HeapArray(HeapArray {
475+
pointer: register_index,
476+
size: compute_size_of_type(&typ),
477+
}),
477478
_ => {
478479
unreachable!("type not supported for conversion into brillig register")
479480
}

crates/noirc_frontend/src/parser/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn function_definition(allow_self: bool) -> impl NoirParser<NoirFunction> {
188188
})
189189
}
190190

191-
/// function_modifiers: 'unconstrained'? 'open'? 'internal'?
191+
/// function_modifiers: 'unconstrained'? 'open'? 'internal'?
192192
///
193193
/// returns (is_unconstrained, is_open, is_internal) for whether each keyword was present
194194
fn function_modifiers() -> impl NoirParser<(bool, bool, bool)> {

0 commit comments

Comments
 (0)