Showing error 1365

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: ldv-regression/ex3_forlist.c_safe.cil.c
Line in file: 9
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

  1/* Generated by CIL v. 1.3.7 */
  2/* print_CIL_Input is true */
  3
  4#line 2 "./assert.h"
  5void __blast_assert(void) 
  6{ 
  7
  8  {
  9  ERROR: 
 10#line 4
 11  goto ERROR;
 12}
 13}
 14#line 13 "files/ex3_forlist.c"
 15void *pp[2]  ;
 16#line 14 "files/ex3_forlist.c"
 17int pstate[2]  ;
 18#line 16 "files/ex3_forlist.c"
 19void init(void) 
 20{ int i ;
 21
 22  {
 23#line 18
 24  i = 0;
 25  {
 26#line 18
 27  while (1) {
 28    while_continue: /* CIL Label */ ;
 29#line 18
 30    if (i < 2) {
 31
 32    } else {
 33#line 18
 34      goto while_break;
 35    }
 36#line 19
 37    pp[i] = (void *)0;
 38#line 20
 39    pstate[i] = 0;
 40#line 18
 41    i = i + 1;
 42  }
 43  while_break: /* CIL Label */ ;
 44  }
 45#line 22
 46  return;
 47}
 48}
 49#line 24 "files/ex3_forlist.c"
 50void f(void *pointer ) 
 51{ int i ;
 52  void *__cil_tmp3 ;
 53  unsigned int __cil_tmp4 ;
 54  unsigned int __cil_tmp5 ;
 55
 56  {
 57#line 26
 58  i = 0;
 59  {
 60#line 26
 61  while (1) {
 62    while_continue: /* CIL Label */ ;
 63#line 26
 64    if (i < 2) {
 65
 66    } else {
 67#line 26
 68      goto while_break;
 69    }
 70    {
 71#line 27
 72    __cil_tmp3 = (void *)0;
 73#line 27
 74    __cil_tmp4 = (unsigned int )__cil_tmp3;
 75#line 27
 76    __cil_tmp5 = (unsigned int )pp[i];
 77#line 27
 78    if (__cil_tmp5 == __cil_tmp4) {
 79#line 28
 80      pp[i] = pointer;
 81#line 29
 82      pstate[i] = 1;
 83#line 30
 84      goto while_break;
 85    } else {
 86
 87    }
 88    }
 89#line 26
 90    i = i + 1;
 91  }
 92  while_break: /* CIL Label */ ;
 93  }
 94#line 33
 95  return;
 96}
 97}
 98#line 35 "files/ex3_forlist.c"
 99void g(void *pointer ) 
100{ int i ;
101  unsigned int __cil_tmp3 ;
102  unsigned int __cil_tmp4 ;
103
104  {
105#line 37
106  i = 0;
107  {
108#line 37
109  while (1) {
110    while_continue: /* CIL Label */ ;
111#line 37
112    if (i < 2) {
113
114    } else {
115#line 37
116      goto while_break;
117    }
118    {
119#line 38
120    __cil_tmp3 = (unsigned int )pointer;
121#line 38
122    __cil_tmp4 = (unsigned int )pp[i];
123#line 38
124    if (__cil_tmp4 == __cil_tmp3) {
125#line 40
126      if (pstate[i] == 1) {
127
128      } else {
129        {
130#line 40
131        __blast_assert();
132        }
133      }
134#line 41
135      pstate[i] = 2;
136    } else {
137
138    }
139    }
140#line 37
141    i = i + 1;
142  }
143  while_break: /* CIL Label */ ;
144  }
145#line 44
146  return;
147}
148}
149#line 46 "files/ex3_forlist.c"
150int counter  =    1;
151#line 47 "files/ex3_forlist.c"
152void *malloc(int size ) 
153{ int tmp ;
154
155  {
156#line 48
157  tmp = counter;
158#line 48
159  counter = counter + 1;
160#line 48
161  return ((void *)tmp);
162}
163}
164#line 52 "files/ex3_forlist.c"
165int main(void) 
166{ int *a ;
167  int *b ;
168  void *tmp ;
169  void *tmp___0 ;
170  int __cil_tmp5 ;
171  int __cil_tmp6 ;
172  int *__cil_tmp7 ;
173  unsigned int __cil_tmp8 ;
174  unsigned int __cil_tmp9 ;
175  int *__cil_tmp10 ;
176  unsigned int __cil_tmp11 ;
177  unsigned int __cil_tmp12 ;
178  void *__cil_tmp13 ;
179  void *__cil_tmp14 ;
180  void *__cil_tmp15 ;
181  void *__cil_tmp16 ;
182
183  {
184  {
185#line 55
186  init();
187#line 56
188  __cil_tmp5 = (int )4U;
189#line 56
190  tmp = malloc(__cil_tmp5);
191#line 56
192  a = (int *)tmp;
193#line 57
194  __cil_tmp6 = (int )4U;
195#line 57
196  tmp___0 = malloc(__cil_tmp6);
197#line 57
198  b = (int *)tmp___0;
199  }
200  {
201#line 58
202  __cil_tmp7 = (int *)0;
203#line 58
204  __cil_tmp8 = (unsigned int )__cil_tmp7;
205#line 58
206  __cil_tmp9 = (unsigned int )a;
207#line 58
208  if (__cil_tmp9 == __cil_tmp8) {
209#line 59
210    return (-1);
211  } else {
212    {
213#line 58
214    __cil_tmp10 = (int *)0;
215#line 58
216    __cil_tmp11 = (unsigned int )__cil_tmp10;
217#line 58
218    __cil_tmp12 = (unsigned int )b;
219#line 58
220    if (__cil_tmp12 == __cil_tmp11) {
221#line 59
222      return (-1);
223    } else {
224
225    }
226    }
227  }
228  }
229  {
230#line 61
231  __cil_tmp13 = (void *)a;
232#line 61
233  f(__cil_tmp13);
234#line 62
235  __cil_tmp14 = (void *)b;
236#line 62
237  f(__cil_tmp14);
238#line 63
239  __cil_tmp15 = (void *)a;
240#line 63
241  g(__cil_tmp15);
242#line 65
243  __cil_tmp16 = (void *)b;
244#line 65
245  g(__cil_tmp16);
246  }
247#line 69
248  return (0);
249}
250}