mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C++: Add 'pthread_create' test with missing flow.
This commit is contained in:
@@ -8,3 +8,4 @@
|
||||
| test.cpp:29:10:29:11 | y3 | test-sink |
|
||||
| test.cpp:33:10:33:11 | z2 | test-sink |
|
||||
| test.cpp:36:10:36:11 | z3 | test-sink |
|
||||
| test.cpp:48:14:48:14 | x | test-sink |
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
| asio_streams.cpp:87:34:87:44 | read_until output argument | remote |
|
||||
| test.cpp:10:10:10:18 | call to ymlSource | local |
|
||||
| test.cpp:56:8:56:16 | call to ymlSource | local |
|
||||
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | local |
|
||||
| windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | local |
|
||||
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local |
|
||||
|
||||
@@ -35,3 +35,26 @@ void test() {
|
||||
int z3 = ymlStepGenerated_with_body(x, 0);
|
||||
ymlSink(z3); // clean
|
||||
}
|
||||
|
||||
struct S {
|
||||
int x;
|
||||
};
|
||||
|
||||
using pthread_t = unsigned long;
|
||||
using pthread_attr_t = void*;
|
||||
|
||||
void *myThreadFunction(void *arg) {
|
||||
S* s = (S *)arg;
|
||||
ymlSink(s->x); // $ MISSING: ir
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int pthread_create(pthread_t *thread, const pthread_attr_t * attr, void *(*start_routine)(void*), void *arg);
|
||||
|
||||
int test_pthread_create() {
|
||||
S s;
|
||||
s.x = ymlSource();
|
||||
|
||||
pthread_t threadId;
|
||||
pthread_create(&threadId, nullptr, myThreadFunction, (void *)&s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user