File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ class DataGraph :
167
167
// Insert into BFS cache.
168
168
if (BFSCache.find (Start) == BFSCache.end ()) {
169
169
std::set<Data> ReachableNodes;
170
- ReachableNodes.clear ();
171
170
for (auto TNode : llvm::breadth_first (*N)) {
172
171
ReachableNodes.insert (TNode->getData ());
173
172
}
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ void foo3(int *x, int c) {
27
27
x [0 ] = c ;
28
28
}
29
29
30
+ void foo4 (int * x , int c ) {
31
+ //CHECK: void foo4(_Array_ptr<int> x, int c) {
32
+ x [0 ] = c ;
33
+ }
34
+
30
35
void bar (void ) {
31
36
int * p = malloc (sizeof (int )* 8 );
32
37
int * q = malloc (sizeof (int )* 8 );
@@ -38,18 +43,27 @@ void bar(void) {
38
43
//CHECK: _Array_ptr<int> q1 : count(8) = malloc<int>(sizeof(int)*8);
39
44
40
45
int n = 8 ;
41
- int l ;
46
+ int l = 4 ;
42
47
int * q2 = malloc (sizeof (int )* l );
48
+ int * q4 = malloc (sizeof (int )* n );
43
49
44
50
// Variation 1
51
+ // Correct size association: second argument is indeed the size.
45
52
foo (p ,n );
46
53
foo (q ,8 );
47
54
48
55
// Variation 2
56
+ // passing fixed size array: No size association.
49
57
foo2 (p1 ,8 );
50
58
foo2 (q1 ,28 );
51
59
52
60
// Variation 3
61
+ // Variable sized arrays: One correct and one wrong bounds.
53
62
foo3 (q2 ,l );
54
63
foo3 (q1 ,28 );
64
+
65
+ // Variation 4
66
+ // Passing wrong lengths to check bounds.
67
+ foo4 (q2 ,n );
68
+ foo4 (q4 ,l );
55
69
}
You can’t perform that action at this time.
0 commit comments