-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5fb152
commit d22fcab
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
trunk/examples/programs/SignedIntegerOverflow/regression/overflow.c
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,22 @@ | ||
//#Safe | ||
// This program clamps an integer and should not produce an overflow. | ||
// Nevertheless, we receive a counterexample with | ||
// -tc AutomizerC.xml | ||
// -s settings/default/automizer/svcomp-Overflow-32bit-Automizer_Default.epf | ||
// on 0.1.24-b5fb152 | ||
// | ||
// We found a FailurePath: | ||
// [L5] x >= 1000000 ? 1000000 : x + 1 | ||
// VAL [\old(x)=-2147483650, x=-2147483650] | ||
// [L5] x + 1 | ||
// VAL [\old(x)=-2147483650, x=-2147483650] | ||
// | ||
// This is probably a bug in library mode where parameters of functions are not assumed to be in range although the option is set. | ||
// | ||
|
||
int foo(); | ||
|
||
int main() { | ||
int x = foo(); | ||
return x >= 1000000 ? 1000000 : x + 1; | ||
} |