Skip to content

Commit 2062a77

Browse files
committed
C++: Add 'std::thread' test with missing flow.
1 parent d198a96 commit 2062a77

File tree

4 files changed

+518
-0
lines changed

4 files changed

+518
-0
lines changed

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7767,6 +7767,27 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future
77677767
| taint.cpp:830:20:830:34 | call to indirect_source | taint.cpp:832:23:832:24 | in | |
77687768
| taint.cpp:831:15:831:17 | out | taint.cpp:832:18:832:20 | out | |
77697769
| taint.cpp:831:15:831:17 | out | taint.cpp:833:8:833:10 | out | |
7770+
| thread.cpp:10:27:10:27 | s | thread.cpp:10:27:10:27 | s | |
7771+
| thread.cpp:10:27:10:27 | s | thread.cpp:11:8:11:8 | s | |
7772+
| thread.cpp:14:26:14:26 | s | thread.cpp:15:8:15:8 | s | |
7773+
| thread.cpp:18:27:18:27 | s | thread.cpp:18:27:18:27 | s | |
7774+
| thread.cpp:18:27:18:27 | s | thread.cpp:19:8:19:8 | s | |
7775+
| thread.cpp:18:34:18:34 | y | thread.cpp:20:8:20:8 | y | |
7776+
| thread.cpp:24:5:24:5 | s | thread.cpp:25:3:25:3 | s | |
7777+
| thread.cpp:24:5:24:5 | s | thread.cpp:26:38:26:38 | s | |
7778+
| thread.cpp:24:5:24:5 | s | thread.cpp:27:37:27:37 | s | |
7779+
| thread.cpp:24:5:24:5 | s | thread.cpp:28:38:28:38 | s | |
7780+
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:26:38:26:38 | s | |
7781+
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:27:37:27:37 | s | |
7782+
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:28:38:28:38 | s | |
7783+
| thread.cpp:25:3:25:16 | ... = ... | thread.cpp:25:5:25:5 | x [post update] | |
7784+
| thread.cpp:25:9:25:14 | call to source | thread.cpp:25:3:25:16 | ... = ... | |
7785+
| thread.cpp:26:18:26:39 | call to thread | thread.cpp:29:1:29:1 | t1 | |
7786+
| thread.cpp:26:38:26:38 | s | thread.cpp:26:37:26:38 | & ... | |
7787+
| thread.cpp:27:18:27:38 | call to thread | thread.cpp:29:1:29:1 | t2 | |
7788+
| thread.cpp:27:37:27:37 | ref arg s | thread.cpp:28:38:28:38 | s | |
7789+
| thread.cpp:28:18:28:43 | call to thread | thread.cpp:29:1:29:1 | t3 | |
7790+
| thread.cpp:28:38:28:38 | s | thread.cpp:28:37:28:38 | & ... | |
77707791
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
77717792
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
77727793
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | |

cpp/ql/test/library-tests/dataflow/taint-tests/stl.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,4 +681,17 @@ namespace std {
681681
// the model for `format`.
682682
template <typename... Args>
683683
int same_signature_as_format_but_different_name(format_string, Args &&...args);
684+
}
685+
686+
namespace std {
687+
class thread {
688+
public:
689+
template<class F, class... Args>
690+
explicit thread(F&&, Args&&...);
691+
692+
~thread();
693+
694+
void join();
695+
void detach();
696+
};
684697
}

0 commit comments

Comments
 (0)