Skip to content

Commit 0edb306

Browse files
asgerfaschackmull
andauthored
Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent 889100a commit 0edb306

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

shared/dataflow/codeql/dataflow/DataFlow.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,12 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
996996
predicate discriminatedPathNode(InputPathNode pathNode) { discriminatedPathNode(pathNode, _) }
997997
}
998998

999+
private InputPathNode getUniqPathNode(Node node, string toString) {
1000+
result = unique(InputPathNode pathNode | pathNode = getAPathNode(node, toString))
1001+
}
1002+
9991003
private predicate initialCandidate(Node node, string toString) {
1000-
exists(getAPathNode(node, toString))
1004+
exists(getAPathNode(node, toString)) and not exists(getUniqPathNode(node, toString))
10011005
}
10021006

10031007
private module Pass1 =
@@ -1017,7 +1021,7 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
10171021
MakeDiscriminatorPass<Pass1::discriminatedPair/2, edgesRev/4, subpathsRev/4>;
10181022

10191023
private newtype TPathNode =
1020-
TPreservedPathNode(InputPathNode node) { Pass2::discriminatedPathNode(node) } or
1024+
TPreservedPathNode(InputPathNode node) { Pass2::discriminatedPathNode(node) or node = getUniqPathNode(_, _) } or
10211025
TCollapsedPathNode(Node node, string toString) {
10221026
initialCandidate(node, toString) and
10231027
not Pass2::discriminatedPair(node, toString)

0 commit comments

Comments
 (0)