You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling multiple functions and using the data bus feature, the compiler fails with this error:
The application panicked (crashed).
Message: index out of bounds: the len is 3 but the index is 3
Location: compiler/noirc_evaluator/src/ssa/opt/inlining.rs:211
Expected Behavior
The compiler should not crash.
Bug
This happens because the code that saves the data bus configuration during SSA gen phase is incorrectly placed after processing all other functions. As such, it saves the configuration to the last compiled function instead of the main function.
To Reproduce
Given this program:
usedep::std;
fnmain(mutx: u32, y: call_datau32, z: call_data [u32;4]) ->return_datau32 {
leta = z[x];
a+foo(y)
}
// Use an unconstrained function to to avoid the compiler inlining itunconstrainedfnfoo(x: u32) ->u32 {
x+1
}
Compile the program with nargo compile. The compiler will panic with the error mentioned above.
Installation Method
Binary
Nargo Version
nargo version = 0.22.0 noirc version = 0.22.0+420a5c74a14dcfeede04337a42282093a7b5e63e (git version hash: 420a5c7, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered:
…rs (#4047)
# Description
## Problem\*
Resolves#4046
## Summary\*
This PR changes saves the data bus configuration before processing the
other queued functions during SSA gen phase.
## Additional Context
With the current implementation the databus will be incorrectly saved to
the last generated function instead of the main function, causing a
panic in a later optimization phase.
## Documentation\*
Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.
# PR Checklist\*
- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Aim
When compiling multiple functions and using the data bus feature, the compiler fails with this error:
Expected Behavior
The compiler should not crash.
Bug
This happens because the code that saves the data bus configuration during SSA gen phase is incorrectly placed after processing all other functions. As such, it saves the configuration to the last compiled function instead of the main function.
To Reproduce
Given this program:
Compile the program with
nargo compile
. The compiler will panic with the error mentioned above.Installation Method
Binary
Nargo Version
nargo version = 0.22.0 noirc version = 0.22.0+420a5c74a14dcfeede04337a42282093a7b5e63e (git version hash: 420a5c7, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: