C++: Add FN.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-03-06 15:53:16 -08:00
parent 3295d5cb9f
commit bf84f3a936

View File

@@ -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