diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 6602f4615e0a..a13c49c54357 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -3370,6 +3370,11 @@ module MakeImpl 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 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)) ) }