forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify tests of is-null that use integer types
Injecting casts to integer types should not hamper our ability to simplify tests for null-ness. Such expressions emerge from Rust code, see model-checking/kani#2191.
- Loading branch information
1 parent
b04cbf3
commit 44567de
Showing
3 changed files
with
58 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,12 @@ | ||
union U | ||
{ | ||
void *ptr; | ||
__CPROVER_size_t n; | ||
}; | ||
|
||
int main() | ||
{ | ||
int *p = __CPROVER_allocate(sizeof(int), 0); | ||
union U u = {.ptr = p}; | ||
__CPROVER_assert(u.n != 0, "is not null"); | ||
} |
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 @@ | ||
CORE new-smt-backend | ||
main.c | ||
|
||
Generated 1 VCC\(s\), 0 remaining after simplification | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring |
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