Fix issue 491 - #531
Open
Felalolf wants to merge 23 commits into
Open
Conversation
added 13 commits
July 20, 2022 21:07
jcp19
approved these changes
Sep 30, 2022
Contributor
Author
|
This PR still has issues because of which it is not merged |
Contributor
For reference, the issue mentioned here is that Gobra is often not able to prove non-nilness of memory locations that are obviously non-nil. Consider the simple example below requires 8 <= len(raw)
preserves forall i int :: { &raw[i] } 0 <= i && i < len(raw) ==>
acc(&raw[i])
func DecodeFromBytes(raw []byte) {
assert forall i int :: 0 <= i && i < len(raw[2:4]) ==>
&raw[2:4][i] == &raw[2 + i]
}In the current status of the PR, we get the following error: [info] Error at: </Users/joao/000491-bug.gobra:7:58> Reading might fail.
[info] The receiver raw[2:4][i] might be nil |
jcp19
self-requested a review
July 18, 2024 12:17
jcp19
marked this pull request as draft
February 19, 2025 13:31
This was referenced May 2, 2026
Member
ArquintL
approved these changes
Aug 13, 2026
Co-authored-by: Linard Arquint <ArquintL@users.noreply.github.com>
Contributor
ArquintL
reviewed
Aug 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR:
safeReferencefor more details.UncheckedRefnode. The node is necessary to make our encoding modular.InterfaceReceiverIsNilReasonto the more generalReceiverIsNilReason.There is one failing test. The test fails due to an error in the desugaring of closures. I will most likely add an
IgnoreFileannotation and open a separate issue. The currently generated internal representation should fail since it contains an unsafe dereference.