Replace fake ZeroInit lattice with flat lattice#2035
Open
sim642 wants to merge 3 commits into
Open
Conversation
sim642
commented
May 15, 2026
Comment on lines
+911
to
+914
| if x = Bot then | ||
| zero_init_value t (* This should be zero initialized *) | ||
| else | ||
| x (* This already contains some value *) |
Member
Author
There was a problem hiding this comment.
This already existing logic seems suspicious: seems it could be non-monotonic and unsound that zero_init_value isn't always included.
Maybe this was fine because the malloc and calloc cases were mutually exclusive before, but now with the top possibility, I'm not so sure anymore. If an initialized malloc blob (so not bot) is joined with an uninitialized calloc blob, then this doesn't add the zero-initialization.
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 is to potentially fix the issue from #2030 (comment).
The added test shows a handcrafted case where a
mallocblob is joined with acallocblob, which requires the joining of theirZeroInitvalues.Previously, this raised an exception and even caused unsoundness because of the fake lattice being used.
This PR replaces that with a flat boolean lattice which can represent top.
TODO