-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1342 from goblint/isssue_1319
Apron: Only replace deref expression with pointed to variable if types coincide
- Loading branch information
Showing
2 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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,30 @@ | ||
// SKIP PARAM: --enable ana.int.def_exc --enable ana.int.interval --set ana.activated[+] apron | ||
int other(); | ||
|
||
int main() | ||
{ | ||
unsigned char *t; | ||
char c = 'b'; | ||
|
||
t = &c; | ||
|
||
// Type of *t and c do not match, this caused a crash before | ||
if(*t == 'a') { | ||
t++; | ||
} | ||
|
||
other(); | ||
} | ||
|
||
int other() | ||
{ | ||
// Same problem, but a bit more involved | ||
unsigned char *t; | ||
char buf[100] = "bliblablubapk\r"; | ||
|
||
t = buf; | ||
|
||
if(*t == 'a') { | ||
t++; | ||
} | ||
} |