Skip to content

Commit dd73a00

Browse files
committed
Handling comments
1 parent 863c402 commit dd73a00

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

clang/include/clang/CConv/ConstraintsGraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ class DataGraph :
167167
// Insert into BFS cache.
168168
if (BFSCache.find(Start) == BFSCache.end()) {
169169
std::set<Data> ReachableNodes;
170-
ReachableNodes.clear();
171170
for (auto TNode : llvm::breadth_first(*N)) {
172171
ReachableNodes.insert(TNode->getData());
173172
}

clang/test/CheckedCRewriter/arrboundsmerging.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ void foo3(int *x, int c) {
2727
x[0] = c;
2828
}
2929

30+
void foo4(int *x, int c) {
31+
//CHECK: void foo4(_Array_ptr<int> x, int c) {
32+
x[0] = c;
33+
}
34+
3035
void bar(void) {
3136
int *p = malloc(sizeof(int)*8);
3237
int *q = malloc(sizeof(int)*8);
@@ -38,18 +43,27 @@ void bar(void) {
3843
//CHECK: _Array_ptr<int> q1 : count(8) = malloc<int>(sizeof(int)*8);
3944

4045
int n = 8;
41-
int l;
46+
int l = 4;
4247
int *q2 = malloc(sizeof(int)*l);
48+
int *q4 = malloc(sizeof(int)*n);
4349

4450
// Variation 1
51+
// Correct size association: second argument is indeed the size.
4552
foo(p,n);
4653
foo(q,8);
4754

4855
// Variation 2
56+
// passing fixed size array: No size association.
4957
foo2(p1,8);
5058
foo2(q1,28);
5159

5260
// Variation 3
61+
// Variable sized arrays: One correct and one wrong bounds.
5362
foo3(q2,l);
5463
foo3(q1,28);
64+
65+
// Variation 4
66+
// Passing wrong lengths to check bounds.
67+
foo4(q2,n);
68+
foo4(q4,l);
5569
}

0 commit comments

Comments
 (0)