C++: Add dataflow through '__builtin_bit_cast'.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-06-06 10:00:18 +01:00
parent 48f2fd0460
commit bd9ece0bd3
3 changed files with 14 additions and 0 deletions

View File

@@ -114,6 +114,13 @@ predicate conversionFlow(
instrTo.(CheckedConvertOrNullInstruction).getUnaryOperand() = opFrom
or
instrTo.(InheritanceConversionInstruction).getUnaryOperand() = opFrom
or
exists(BuiltInInstruction builtIn |
builtIn = instrTo and
// __builtin_bit_cast
builtIn.getBuiltInOperation() instanceof BuiltInBitCast and
opFrom = builtIn.getAnOperand()
)
)
or
additional = true and