-
Notifications
You must be signed in to change notification settings - Fork 219
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(acir_gen): Pass accurate contents to slice inputs for bb func calls #2435
Conversation
@sirasistant I added the test from the issue, but it would be great if you could test this fix against the sha256 + ecdsa as well |
Will test it! I think this might also be an issue in brillig? 🤔 |
Yeah it is, I am fixing |
@sirasistant I have updated for brillig as well now. This should be ready for review |
It's fixed on aztec packages! 🥳 reviewing now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! We might want in the future to abstract this a bit, especially if we end up having a blackbox function that accepts more than one slice, It'd be complex to handle this way
I agree. I more meant for this to be a quick solution as I work towards other priorities. I will make an issue to improve the handling of black box inputs |
@sirasistant I just pushed an update which dismissed your review, could you take another look? |
* master: fix: Implement new mem2reg pass (#2420) feat(nargo): Support optional directory in git dependencies (#2436) fix(acir_gen): Pass accurate contents to slice inputs for bb func calls (#2435) fix(ssa): codegen missing check for unary minus (#2413) fix(lsp): Remove duplicated creation of lenses (#2433) feat: Add `test(should_fail)` attribute for tests that are meant to fail (#2418) chore: improve error message for InternalError (#2429) chore: Add stdlib to every crate as it is added to graph (#2392)
Description
Problem*
Resolves #2421
Summary*
The internal structure of slices in SSA was changed in #2347. Slices and arrays are polymorphic over each other, thus slices can be passed to functions that accept arrays with a generic size (ex. fn foo(input: [Field; N]). The slice structure is handled in SSA, but in ACIR gen we setup the inputs to for the black box calls manually. As the slice length always precedes the slice contents, without changes to
call_black_box
in acir gen, the slice length was being passed to the bb funcs rather than the contents of the slice.Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.