Skip to content

Commit 89cf215

Browse files
committed
C++: Add models for 'std::thread' and accept test changes.
1 parent 2062a77 commit 89cf215

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cpp/ql/lib/ext/std.thread.model.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: summaryModel
5+
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
6+
- ["std", "thread", True, "thread", "", "", "Argument[*@1]", "Argument[0].Parameter[@0]", "value", "manual"]
7+
- ["std", "thread", True, "thread", "", "", "Argument[*@2]", "Argument[0].Parameter[@1]", "value", "manual"]
8+
- ["std", "thread", True, "thread", "", "", "Argument[*@3]", "Argument[0].Parameter[@2]", "value", "manual"]
9+
- ["std", "thread", True, "thread", "", "", "Argument[*@4]", "Argument[0].Parameter[@3]", "value", "manual"]
10+
- ["std", "thread", True, "thread", "", "", "Argument[*@5]", "Argument[0].Parameter[@4]", "value", "manual"]
11+

cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ struct S {
88
};
99

1010
void thread_function_1(S* s) {
11-
sink(s->x); // $ MISSING: ir
11+
sink(s->x); // $ ir
1212
}
1313

1414
void thread_function_2(S s) {
15-
sink(s.x); // $ MISSING: ir
15+
sink(s.x); // $ ir
1616
}
1717

1818
void thread_function_3(S* s, int y) {
19-
sink(s->x); // $ MISSING: ir
19+
sink(s->x); // $ ir
2020
sink(y); // clean
2121
}
2222

0 commit comments

Comments
 (0)