-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[smt_convt] Fix comparison of invalid pointers
The SMT conversion routines crashed on encoding of comparisons over invalid pointers. This change fixes this behavior by ignoring comparisons against invalid pointers.
- Loading branch information
1 parent
0edf9a5
commit 7663a57
Showing
3 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
void main() | ||
{ | ||
char *data = nondet() ? NULL : malloc(8); | ||
memset(data, 0, 8); | ||
memset(data, 0, 8); | ||
} |
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,12 @@ | ||
CORE | ||
main.c | ||
|
||
^\[main.precondition_instance.1\] line .* memset destination region writeable: FAILURE$ | ||
^\[main.precondition_instance.2\] line .* memset destination region writeable: FAILURE$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION FAILED$ | ||
-- | ||
-- | ||
This test case checks that byte operations (e.g. memset) oninvalid and `NULL` | ||
pointers are correctly encoded in SMT2. |
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