Skip to content

Commit

Permalink
fix(brillig_gen): Pass correct size of complex types input for brilli…
Browse files Browse the repository at this point in the history
…g foreign calls (#1922)

fix size of HeapArray passed to brillig foreign calls
  • Loading branch information
vezenovm authored Jul 13, 2023
1 parent 4969da7 commit 04c89d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,10 @@ impl<'block> BrilligBlock<'block> {
let typ = dfg[value_id].get_type();
match typ {
Type::Numeric(_) => RegisterOrMemory::RegisterIndex(register_index),
Type::Array(_, size) => {
RegisterOrMemory::HeapArray(HeapArray { pointer: register_index, size })
}
Type::Array(..) => RegisterOrMemory::HeapArray(HeapArray {
pointer: register_index,
size: compute_size_of_type(&typ),
}),
_ => {
unreachable!("type not supported for conversion into brillig register")
}
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ fn function_definition(allow_self: bool) -> impl NoirParser<NoirFunction> {
})
}

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

0 comments on commit 04c89d2

Please sign in to comment.