-
Notifications
You must be signed in to change notification settings - Fork 84
Limit address sets to include at most one string pointer #808
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 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d403505
Add test for string pointer analysis
jerhard ce60826
Limit address sets to only keep one explicit string pointer.
jerhard ebd65d4
Add checks to regression tests that unknown pointers and string point…
jerhard a65f633
Update comment, fix code style
jerhard 7e3a5d2
Introduce option ana.base.limit-string-addresses to configure whether…
jerhard 0be8a3b
Hash all StrPtrs to same value when they need to be considered compar…
jerhard 019d76e
Fix typo
jerhard d6e329a
Add description of ana.base.limit-string-addresses option
jerhard 54e38e3
Fix NormalLat.leq for StrPtr
jerhard e54e9bb
Add limit-string-addresses = false to very-precise.json configuration
jerhard 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
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
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
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,36 @@ | ||
| //PARAM: --disable ana.base.limit-string-addresses | ||
| #include <stdlib.h> | ||
|
|
||
| char *unknown_function(); | ||
|
|
||
| int main(){ | ||
| char* str = "Hello"; | ||
| char* str2 = "Hello"; | ||
| char* str3 = "hi"; | ||
| char* str4 = "other string"; | ||
|
|
||
| // Unknown since the there may be multiple copies of the same string | ||
| __goblint_check(str != str2); // UNKNOWN! | ||
|
|
||
| __goblint_check(str == str); | ||
| __goblint_check(str != str3); | ||
|
|
||
| char *ptr = NULL; | ||
| int top = rand(); | ||
|
|
||
| if(top){ | ||
| ptr = str2; | ||
| } else { | ||
| ptr = str3; | ||
| } | ||
| __goblint_check(ptr == str); //UNKNOWN! | ||
|
|
||
| __goblint_check(ptr != str4); | ||
|
|
||
| char *ptr2 = unknown_function(); | ||
|
|
||
| __goblint_check(ptr2 == str); //UNKNOWN! | ||
| __goblint_check(ptr2 == ptr); //UNKNOWN! | ||
|
|
||
| return 0; | ||
| } |
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.