File: vla_goto2.res.oracle

package info (click to toggle)
frama-c 20220511-manganese-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 66,492 kB
  • sloc: ml: 278,834; ansic: 47,093; sh: 4,823; makefile: 3,613; javascript: 2,436; python: 1,919; perl: 897; lisp: 293; xml: 62
file content (57 lines) | stat: -rw-r--r-- 1,415 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[kernel] Parsing vla_goto2.i (no preprocessing)
/* Generated by Frama-C */
/*@ assigns \nothing;
    frees p; */
 __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p);

/*@ assigns \result;
    assigns \result \from \nothing;
    allocates \result; */
 __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size);

int case2(int arg)
{
  int __retres;
  {
    unsigned int __lengthof_a2;
    /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ;
    __lengthof_a2 = (unsigned int)arg;
    int *a2 = __fc_vla_alloc(sizeof(int) * __lengthof_a2);
    if (arg) {
      __fc_vla_free((void *)a2);
      goto L;
    }
    __fc_vla_free((void *)a2);
  }
  {
    unsigned int __lengthof_b2;
    L: ;
    /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ;
    __lengthof_b2 = (unsigned int)arg;
    int *b2 = __fc_vla_alloc(sizeof(int) * __lengthof_b2);
    __fc_vla_free((void *)b2);
  }
  __retres = 0;
  return __retres;
}

int case3(int arg)
{
  int __retres;
  {
    unsigned int __lengthof_vla;
    /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ;
    __lengthof_vla = (unsigned int)arg;
    int *vla = __fc_vla_alloc(sizeof(int) * __lengthof_vla);
    if (arg >= 10) {
      __retres = 1;
      __fc_vla_free((void *)vla);
      goto return_label;
    }
    __retres = 0;
    __fc_vla_free((void *)vla);
  }
  return_label: return __retres;
}