-
Notifications
You must be signed in to change notification settings - Fork 220
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
Handle out-of-bound errors in CSE (#471) #673
Conversation
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.
Could we thread location data into instructions (or rather NodeObj) so that we can display where the error has occurred as per the issue description?
Having the error
error: index out of bounds
is definitely better than a panic, but in a large circuit it might be hard to find this problem.
For some reason it looks like the secondary message of the diagnostic is not outputting for me. Is what I pasted above what you see or is your error more descriptive? I also did not get a secondary message for the diagnostic you added here: #672.
Yes, we have already an issue open for this: #472
Yes I have the same, it is due to what I said in #672:
|
Ah I missed the additional context. Ok in this case I am fine with these PRs then and a PR fixing #472 will alleviate my concerns. What do you think about moving the secondary messages to the main message until we have a location to associate with the errors? |
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.
Added a comment RE not embedding the Error variant in CseAction
I was thinking the same, but it should be done when we report the error; if there is no location, we print the secondary message as part of the main message. |
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.
Looks good, though I would like to see some Location
handling as part of this PR though. Adding them to every instruction is out of scope but can we add them to only Index
ast nodes and the Operation::Store
and Operation::Load
s that result from them?
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.
Looks good to me. We can merge once the clippy issues are fixed
* master: Rename methods that use `conditionalize` to be more descriptive (#739) feat(noir)!: Returned values are no longer required by the prover (#731) chore: explicit versions for dependencies (#727) chore: readability improvements (#726) feat(nargo): include short git commit in cli version output (#721) Remove print to console for named proofs in `nargo prove` (#718) chore: clean up serde-related dependencies (#722) Handle out-of-bound errors in CSE (#471) (#673) Remove unused dependencies and only use workspace inheritance on shared deps (#671) feat(std_lib)!: modulus bits/bytes methods, and to_bits -> to_le_bits (#697) Implement numeric generics (#620) Review some TODO in SSA (#698) Replace `toml_map_to_field` and `toml_remap` with traits to map between `InputValue`s and `TomlTypes` (#677) Apply witness visibility on a parameter level rather than witness level (#712)
Related issue(s)
Resolves #471
Description
Summary of changes
report an error when trying to access an array with index out-of-bounds during CSE
Checklist
cargo fmt
with default settings.