Showing error 1480

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: loops/for_bounded_loop1_unsafe.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 void __VERIFIER_assume(int);
 2void __VERIFIER_assert(int cond) {
 3  if (!(cond)) {
 4    ERROR: goto ERROR;
 5  }
 6  return;
 7}
 8
 9int __VERIFIER_nondet_int();
10
11int main() {
12  int i=0, x=0, y=0;
13  int n=__VERIFIER_nondet_int();
14  __VERIFIER_assume(n>0);
15  for(i=0; i<n; i++)
16  {
17    x = x-y;
18    __VERIFIER_assert(x==0);
19    y = __VERIFIER_nondet_int();
20    __VERIFIER_assume(y!=0);
21    x = x+y;
22    __VERIFIER_assert(x!=0);
23  }
24  __VERIFIER_assert(x==0);
25}