Skip to content

Commit 639d715

Browse files
authored
Merge pull request github#1226 from hvitved/dataflow/prepare-for-csharp
Generalize data-flow library in preparation for C# adoption
2 parents 19c7360 + d9bf0a6 commit 639d715

28 files changed

+3907
-2291
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowDispatch.qll

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
private import cpp
2-
private import DataFlowPrivate
32

4-
Function viableImpl(MethodAccess ma) {
5-
result = viableCallable(ma)
6-
}
3+
Function viableImpl(Call call) { result = viableCallable(call) }
74

85
/**
96
* Gets a function that might be called by `call`.
@@ -61,31 +58,23 @@ private predicate functionSignature(Function f, string qualifiedName, int nparam
6158
* Holds if the call context `ctx` reduces the set of viable dispatch
6259
* targets of `ma` in `c`.
6360
*/
64-
predicate reducedViableImplInCallContext(MethodAccess ma, Callable c, Call ctx) {
65-
none()
66-
}
61+
predicate reducedViableImplInCallContext(Call call, Function f, Call ctx) { none() }
6762

6863
/**
6964
* Gets a viable dispatch target of `ma` in the context `ctx`. This is
7065
* restricted to those `ma`s for which the context makes a difference.
7166
*/
72-
Method prunedViableImplInCallContext(MethodAccess ma, Call ctx) {
73-
none()
74-
}
67+
Function prunedViableImplInCallContext(Call call, Call ctx) { none() }
7568

7669
/**
7770
* Holds if flow returning from `m` to `ma` might return further and if
7871
* this path restricts the set of call sites that can be returned to.
7972
*/
80-
predicate reducedViableImplInReturn(Method m, MethodAccess ma) {
81-
none()
82-
}
73+
predicate reducedViableImplInReturn(Function f, Call call) { none() }
8374

8475
/**
8576
* Gets a viable dispatch target of `ma` in the context `ctx`. This is
8677
* restricted to those `ma`s and results for which the return flow from the
8778
* result to `ma` restricts the possible context `ctx`.
8879
*/
89-
Method prunedViableImplInCallContextReverse(MethodAccess ma, Call ctx) {
90-
none()
91-
}
80+
Function prunedViableImplInCallContextReverse(Call call, Call ctx) { none() }

0 commit comments

Comments
 (0)