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

BadConstantEquality error when trying to write out of array bounds #1918

Closed
spalladino opened this issue Jul 12, 2023 · 0 comments · Fixed by #1927
Closed

BadConstantEquality error when trying to write out of array bounds #1918

spalladino opened this issue Jul 12, 2023 · 0 comments · Fixed by #1927
Assignees
Labels
bug Something isn't working

Comments

@spalladino
Copy link
Contributor

Aim

Given the following code which uses BoundedVec to accumulate a hash:

let mut args: BoundedVec<Field, 75> = BoundedVec::new(0);
args = args.push_array(payload.serialize());
for byte in owner {
    args = args.push(byte as Field);
}
args = args.push_array(signature);
args = args.push(partialContractAddress);

If the length of BoundedVec is set to less than 75, the compiler crashes with an error.

Expected Behavior

Compiler should return an error complaining about array access out of bounds.

Bug

The application panicked (crashed).
Message:  add Result types to all methods so errors bubble up: BadConstantEquality { lhs: 0, rhs: 1 }
Location: crates/noirc_evaluator/src/ssa_refactor/acir_gen/mod.rs:251

To Reproduce

No response

Installation Method

Compiled from source

Nargo Version

nargo 0.8.0 (git version hash: 6fa3144, is dirty: false)

Additional Context

Ran in the context of aztec-packages

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@spalladino spalladino added the bug Something isn't working label Jul 12, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jul 12, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants