File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ private import SsaInternals as Ssa
17
17
private import DataFlowImplCommon as DataFlowImplCommon
18
18
private import codeql.util.Unit
19
19
private import Node0ToString
20
+ private import DataFlowDispatch as DataFlowDispatch
20
21
import ExprNodes
21
22
22
23
/**
@@ -2497,3 +2498,16 @@ class AdditionalCallTarget extends Unit {
2497
2498
*/
2498
2499
abstract Declaration viableTarget ( Call call ) ;
2499
2500
}
2501
+
2502
+ /**
2503
+ * Gets a function that may be called by `call`.
2504
+ *
2505
+ * Note that `call` may be a call to a function pointer expression.
2506
+ */
2507
+ Function getARuntimeTarget ( Call call ) {
2508
+ exists ( DataFlowCall dfCall | dfCall .asCallInstruction ( ) .getUnconvertedResultExpression ( ) = call |
2509
+ result = DataFlowDispatch:: viableCallable ( dfCall ) .asSourceCallable ( )
2510
+ or
2511
+ result = DataFlowImplCommon:: viableCallableLambda ( dfCall , _) .asSourceCallable ( )
2512
+ )
2513
+ }
You can’t perform that action at this time.
0 commit comments