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
1717private import DataFlowImplCommon as DataFlowImplCommon
1818private import codeql.util.Unit
1919private import Node0ToString
20+ private import DataFlowDispatch as DataFlowDispatch
2021import ExprNodes
2122
2223/**
@@ -2497,3 +2498,16 @@ class AdditionalCallTarget extends Unit {
24972498 */
24982499 abstract Declaration viableTarget ( Call call ) ;
24992500}
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