-
Notifications
You must be signed in to change notification settings - Fork 381
fix: set index and value to 0 for array_get with predicate #4971
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ed37142
set index and value to 0 for array_get with predicate
guipublic da04a1e
Merge branch 'master' into gd/pw_issue
guipublic 6a54648
Merge branch 'master' into gd/pw_issue
TomAFrench 26ba2df
Merge branch 'master' into gd/pw_issue
guipublic 6004ef9
avoid the multiplication when first element matches or if the array i…
guipublic 71a3921
Merge branch 'master' into gd/pw_issue
guipublic c0c95a6
update test case
guipublic 7ac7265
Code review
guipublic 0ffbfb9
add the PR in comment
guipublic 3c82b70
Merge branch 'master' into gd/pw_issue
guipublic 0a0cb79
nargo fmt
guipublic 61269c8
Merge branch 'master' into gd/pw_issue
guipublic 61e94a5
code review
guipublic c4884ca
code review
guipublic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test_programs/execution_success/regression_struct_array_conditional/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [package] | ||
| name = "regression_struct_array_conditional" | ||
| version = "0.1.0" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
18 changes: 18 additions & 0 deletions
18
test_programs/execution_success/regression_struct_array_conditional/Prover.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| y = 1 | ||
| z = 1 | ||
|
|
||
| [[x]] | ||
| value = "0x23de33be058ce5504e1ade738db8bdacfe268fa9dbde777092bf1d38519bdf59" | ||
| counter = "10" | ||
| dummy = "0" | ||
|
|
||
| [[x]] | ||
| value = "3" | ||
| counter = "2" | ||
| dummy = "0" | ||
|
|
||
| [[x]] | ||
| value = "2" | ||
| counter = "0" | ||
| dummy = "0" | ||
|
|
11 changes: 11 additions & 0 deletions
11
test_programs/execution_success/regression_struct_array_conditional/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| struct foo { | ||
| value: Field, | ||
| counter: u8, | ||
| dummy: u8, | ||
| } | ||
| fn main(x: [foo; 3], y: u32, z: u32) -> pub u8 { | ||
| if z == 0 { | ||
| assert(y as u8 < x[y].counter); | ||
| } | ||
| x[0].counter | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.