mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C++: Add FN.
This commit is contained in:
@@ -189,4 +189,24 @@ void test15() {
|
||||
UInt8_with_more* u8 = (UInt8_with_more*)u64; // BAD
|
||||
}
|
||||
|
||||
// semmle-extractor-options: --gcc -std=c++11
|
||||
struct SingleInt {
|
||||
int i;
|
||||
} __attribute__((packed));;
|
||||
|
||||
struct PairInts {
|
||||
int x, y;
|
||||
} __attribute__((packed));;
|
||||
|
||||
union MyUnion
|
||||
{
|
||||
PairInts p;
|
||||
unsigned long long foo;
|
||||
} __attribute__((packed));
|
||||
|
||||
void test16() {
|
||||
void* si = new SingleInt;
|
||||
// ...
|
||||
MyUnion* mu = (MyUnion*)si; // BAD [NOT DETECTED]
|
||||
}
|
||||
|
||||
// semmle-extractor-options: --gcc -std=c++11
|
||||
Reference in New Issue
Block a user