File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
lib/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow/dataflow-tests Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,13 @@ predicate conversionFlow(
114
114
instrTo .( CheckedConvertOrNullInstruction ) .getUnaryOperand ( ) = opFrom
115
115
or
116
116
instrTo .( InheritanceConversionInstruction ) .getUnaryOperand ( ) = opFrom
117
+ or
118
+ exists ( BuiltInInstruction builtIn |
119
+ builtIn = instrTo and
120
+ // __builtin_bit_cast
121
+ builtIn .getBuiltInOperation ( ) instanceof BuiltInBitCast and
122
+ opFrom = builtIn .getAnOperand ( )
123
+ )
117
124
)
118
125
or
119
126
additional = true and
Original file line number Diff line number Diff line change @@ -52,3 +52,9 @@ void following_pointers( // $ ast-def=sourceStruct1_ptr ir-def=*cleanArray1 ir-d
52
52
sink (stackArray); // $ ast,ir
53
53
indirect_sink (stackArray); // $ ast ir=50:25 ir=50:35 ir=51:19
54
54
}
55
+
56
+ void test_bitcast () {
57
+ unsigned long x = source ();
58
+ double d = __builtin_bit_cast (double , x);
59
+ sink (d); // $ ir MISSING: ast
60
+ }
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ irFlow
153
153
| clang.cpp:50:25:50:30 | call to source | clang.cpp:53:17:53:26 | *stackArray |
154
154
| clang.cpp:50:35:50:40 | call to source | clang.cpp:53:17:53:26 | *stackArray |
155
155
| clang.cpp:51:19:51:24 | call to source | clang.cpp:53:17:53:26 | *stackArray |
156
+ | clang.cpp:57:21:57:28 | call to source | clang.cpp:59:8:59:8 | d |
156
157
| dispatch.cpp:9:37:9:42 | call to source | dispatch.cpp:35:16:35:25 | call to notSource1 |
157
158
| dispatch.cpp:9:37:9:42 | call to source | dispatch.cpp:43:15:43:24 | call to notSource1 |
158
159
| dispatch.cpp:10:37:10:42 | call to source | dispatch.cpp:36:16:36:25 | call to notSource2 |
You can’t perform that action at this time.
0 commit comments