Showing error 17

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: bitvector/num_conversion_2_safe.i
Line in file: 4
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

 1extern int nondet_int(void);
 2void __VERIFIER_assert(int cond) {
 3  if (!(cond)) {
 4    ERROR: goto ERROR;
 5  }
 6  return;
 7}
 8
 9
10int main()
11{
12    unsigned char x;
13    unsigned char y;
14    unsigned char c;
15
16    y = 0;
17    c = 0;
18    while (c < (unsigned char)8) {
19        unsigned char i = ((unsigned char)1) << c;
20        unsigned char bit = x & i;
21        if (bit != (unsigned char)0) {
22            y = y + i;
23        }
24        c = c + ((unsigned char)1);
25    }
26    __VERIFIER_assert(x == y);
27
28    return 0;
29}