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.
Field sensitivity: account for array size in all index expressions
When code outside the core field-sensitivity implementation produces index expressions we must not blindly turn such expressions into ssa_exprt.
- Loading branch information
1 parent
c66ffbe
commit 40bca65
Showing
3 changed files
with
72 additions
and
17 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 @@ | ||
union U | ||
{ | ||
unsigned char buf[2]; | ||
} s; | ||
|
||
int main() | ||
{ | ||
__CPROVER_assert(s.buf[0] == 0, ""); | ||
} |
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 | ||
--max-field-sensitivity-array-size 1 | ||
^VERIFICATION SUCCESSFUL$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The test is a minimized version of code generated using Kani. It should pass | ||
irrespective of whether field sensitivity is applied to the array or not. (The | ||
original example was unexpectedly failing with an array size of 65, but passed | ||
with an array size of 64 or less.) |
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