blob: be4280824a3e99a0192c7766e230d5018906a1a0 (
plain) (
blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
struct Data1;
struct Data2;
struct Data2
{
int val;
Data1 *ptrval;
int arr[3];
Data1 *getData3()
{
return ptrval;
}
};
struct Data1
{
int val;
Data1 *ptrval;
Data2 perm;
int arr[3];
virtual ~Data1();
Data1 *getData2()
{
return ptrval;
}
virtual Data1 *getData3(int &k)
{
val = k;
return ptrval;
}
static Data1 *getData4()
{
return 0;
}
Data2 *getData5() __attribute__((returns_nonnull))
{
return &perm;
}
virtual Data1 *getData6()
{
return 0;
}
};
int k;
Data1 *gptr1;
Data1 *gptr2 __attribute__((nonnullpointer));
void paranuckerInternalTest(const char *action, const char *collection, const char *values);
class Object1
{
Data1 *tmp1;
Data1 *tmp2;
Data1 *tmp3 __attribute__((nonnullpointer));
int x;
int y;
Data1 *getData1()
{
return tmp2;
}
Data1 *getData2()
{
return tmp2;
}
void func1(Data1 *ptr1) const
{
tmp1->val = 100;
}
void func2(Data1 *ptr1) const
{
tmp3->val = 100;
}
void func3(Data1 *ptr1) const
{
gptr1->val = 100;
}
void func4(Data1 *ptr1) const
{
gptr2->val = 100;
}
void func5(Data1 *ptr1) const
{
tmp1->getData2();
}
void func6(Data1 *ptr1) const
{
tmp3->getData2();
}
void func7(Data1 *ptr1) const
{
Data1 val1;
val1.val = 100;
}
void func8(Data1 &ptr1) const
{
ptr1.val = 200;
}
void func9(Data1 *ptr1) const
{
Data1 *val1;
val1->val = 300;
}
void func10(Data1 &ptr1) const
{
if (ptr1.val == 100)
k = 100;
}
void func11(Data2 &ptr1) const
{
if (ptr1.val == 100)
k = 100;
}
int func12(Data2 &ptr1) const
{
const int &ref1 = ptr1.val;
return ref1;
}
// broken for now
void func13(Data1 *ptr1) const
{
tmp3->getData2()->val = 100;
}
// broken for now
void func14(Data1 *ptr1) const
{
tmp1->getData2()->val = 100;
}
void func15(Data1 *ptr1) const
{
if (ptr1 && ptr1->getData6() && k == 200)
ptr1->val = 100;
}
void func16(Data2 &ptr1) const
{
if (ptr1.ptrval)
ptr1.ptrval->val = 100;
}
void func17(Data1 *ptr1)
{
x = gptr2->val;
y = gptr2->val;
}
void func18(Data1 *ptr1) const
{
if (gptr1 && gptr1->getData6())
gptr1->val = 100;
}
void func19(Data1 *ptr1) const
{
// if (gptr1 && gptr1->getData6() && k == 200)
if (gptr1 && gptr1->getData6())
gptr1->val = 100;
}
};
|