Merge pull request #16602 from hvitved/dataflow/fix-bad-join

Data flow: Fix bad join
This commit is contained in:
Tom Hvitved
2024-05-29 09:53:56 +02:00
committed by GitHub

View File

@@ -3370,6 +3370,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
Location getLocation() { result = p.getLocation() }
}
pragma[nomagic]
private predicate stage5ConsCand(Content c, DataFlowType t, AccessPathFront apf, int len) {
Stage5::consCand(c, t, any(AccessPathApprox ap | ap.getFront() = apf and ap.len() = len - 1))
}
/**
* Gets the number of length 2 access path approximations that correspond to `apa`.
*/
@@ -3377,11 +3382,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
exists(Content c, int len |
c = apa.getHead() and
len = apa.len() and
result =
strictcount(DataFlowType t, AccessPathFront apf |
Stage5::consCand(c, t,
any(AccessPathApprox ap | ap.getFront() = apf and ap.len() = len - 1))
)
result = strictcount(DataFlowType t, AccessPathFront apf | stage5ConsCand(c, t, apf, len))
)
}