forked from thradams/cake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_12600.c
85 lines (63 loc) · 1.21 KB
/
test_12600.c
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma safety enable
void* _Owner _Opt malloc(unsigned long size);
void free(void* _Owner _Opt ptr);
void f1()
{
void * _Owner _Opt p = malloc(1);
if (p) {
static_state(p, "not-null ");
}
static_state(p, "null | not-null ");
free(p);
}
void f2(int condition)
{
void * _Owner _Opt p = malloc(1);
if (condition) {
static_state(p, "null | not-null ");
}
static_state(p, "null | not-null ");
static_set(p, "null");
}
void f3(int condition)
{
void * _Owner _Opt p = malloc(1);
if (condition) {
free(p);
}
else {
free(p);
}
static_state(p, "uninitialized");
}
void f3(int condition)
{
void * _Owner _Opt p = malloc(1);
if (condition) {
}
else {
free(p);
}
static_state(p, "uninitialized null | not-null ");
static_set(p, "null");
}
void f4(int condition)
{
void * _Owner _Opt p = malloc(1);
if (condition) {
free(p);
}
else {
}
static_state(p, "uninitialized null | not-null ");
static_set(p, "null");
}
void f5(int condition)
{
void * _Owner _Opt p = malloc(1);
if (p) {
free(p);
return;
}
static_state(p, "null ");
}