Skip to content

Commit a2e6848

Browse files
committed
Shared: allow exclusions to localFlowIsLocal
1 parent 916fe69 commit a2e6848

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ signature module InputSig<LocationSig Location, DF::InputSig<Location> DataFlowL
7474
) {
7575
none()
7676
}
77+
78+
/** Holds if `(n1, n2)` should be excluded from the consistency test `localFlowIsLocal`. */
79+
default predicate localFlowIsLocalExclude(DataFlowLang::Node n1, DataFlowLang::Node n2) { none() }
7780
}
7881

7982
module MakeConsistency<
@@ -169,6 +172,7 @@ module MakeConsistency<
169172
query predicate localFlowIsLocal(Node n1, Node n2, string msg) {
170173
simpleLocalFlowStep(n1, n2, _) and
171174
nodeGetEnclosingCallable(n1) != nodeGetEnclosingCallable(n2) and
175+
not Input::localFlowIsLocalExclude(n1, n2) and
172176
msg = "Local flow step does not preserve enclosing callable."
173177
}
174178

0 commit comments

Comments
 (0)