forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD.cpp
More file actions
66 lines (55 loc) · 1.35 KB
/
D.cpp
File metadata and controls
66 lines (55 loc) · 1.35 KB
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
void sink(void *o);
class D {
public:
struct Elem { };
struct Box1 {
Elem *elem;
Box1(Elem *e) { elem = e; }
Elem* getElem() { return elem; }
void setElem(Elem *e) { elem = e; }
};
struct Box2 {
Box1* box;
Box2(Box1* b) { box = b; }
Box1* getBox1() { return box; }
void setBox1(Box1* b) { box = b; }
};
static void sinkWrap(Box2* b2) {
sink(b2->getBox1()->getElem()); // $ast=28:15 ast=35:15 ast=42:15 ast=49:15 MISSING: ir
}
Box2* boxfield;
void f1() {
Elem* e = new Elem(); // source of flow to sinkWrap
Box2* b = new Box2(new Box1(nullptr));
b->box->elem = e;
sinkWrap(b);
}
void f2() {
Elem* e = new Elem(); // source of flow to sinkWrap
Box2* b = new Box2(new Box1(nullptr));
b->box->setElem(e);
sinkWrap(b);
}
void f3() {
Elem* e = new Elem(); // source of flow to sinkWrap
Box2* b = new Box2(new Box1(nullptr));
b->getBox1()->elem = e;
sinkWrap(b);
}
void f4() {
Elem* e = new Elem(); // source of flow to sinkWrap
Box2* b = new Box2(new Box1(nullptr));
b->getBox1()->setElem(e);
sinkWrap(b);
}
void f5a() {
Elem* e = new Elem(); // source of flow to f5b
boxfield = new Box2(new Box1(nullptr));
boxfield->box->elem = e;
f5b();
}
private:
void f5b() {
sink(boxfield->box->elem); // $ ast MISSING: ir
}
};