Skip to content

Commit 140ff53

Browse files
committed
C++: Split 'defaultViableCallable' and 'viableCallable'.
1 parent 782ecd7 commit 140ff53

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowDispatch.qll

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ private import DataFlowImplCommon as DataFlowImplCommon
77

88
/**
99
* Gets a function that might be called by `call`.
10+
*
11+
* This predicate does not take additional call targets
12+
* from `AdditionalCallTarget` into account.
1013
*/
1114
cached
12-
DataFlowCallable viableCallable(DataFlowCall call) {
15+
DataFlowCallable defaultViableCallable(DataFlowCall call) {
1316
DataFlowImplCommon::forceCachingInSameStage() and
1417
result = call.getStaticCallTarget()
1518
or
@@ -27,6 +30,14 @@ DataFlowCallable viableCallable(DataFlowCall call) {
2730
or
2831
// Virtual dispatch
2932
result = call.(VirtualDispatch::DataSensitiveCall).resolve()
33+
}
34+
35+
/**
36+
* Gets a function that might be called by `call`.
37+
*/
38+
cached
39+
DataFlowCallable viableCallable(DataFlowCall call) {
40+
result = defaultViableCallable(call)
3041
or
3142
// Additional call targets
3243
result = any(AdditionalCallTarget additional).viableTarget(call.getUnconvertedResultExpression())

0 commit comments

Comments
 (0)