We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dc7b64 commit 5a4efabCopy full SHA for 5a4efab
cpp/ql/test/library-tests/dataflow/smart-pointers-taint/test.cpp
@@ -25,4 +25,22 @@ void test_unique_ptr_struct() {
25
sink(p1->y);
26
sink(p2->x); // $ ir=22:46
27
sink(p2->y); // $ SPURIOUS: ir=22:46
28
+}
29
+
30
+void test_shared_ptr_int() {
31
+ std::shared_ptr<int> p1(new int(source()));
32
+ std::shared_ptr<int> p2 = std::make_shared<int>(source());
33
34
+ sink(*p1); // $ ast
35
+ sink(*p2); // $ ast ir=32:50
36
37
38
+void test_shared_ptr_struct() {
39
+ std::shared_ptr<A> p1(new A{source(), 0});
40
+ std::shared_ptr<A> p2 = std::make_shared<A>(source(), 0);
41
42
+ sink(p1->x); // $ MISSING: ast,ir
43
+ sink(p1->y);
44
+ sink(p2->x); // $ ir=40:46
45
+ sink(p2->y); // $ SPURIOUS: ir=40:46
46
}
0 commit comments