Skip to content

Commit f3a381f

Browse files
authored
Merge pull request github#15822 from aschackmull/dataflow/perf-fixes
Dataflow: Misc performance fixes
2 parents 6d5fd3c + caa4505 commit f3a381f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,11 +1904,11 @@ module MakeImpl<InputSig Lang> {
19041904
pragma[nomagic]
19051905
private predicate returnFlowsThrough(
19061906
RetNodeEx ret, ReturnPosition pos, FlowState state, CcCall ccc, ParamNodeEx p, Typ argT,
1907-
Ap argAp, Ap ap
1907+
Ap argAp, ApApprox argApa, Ap ap
19081908
) {
1909-
exists(DataFlowCall call, ApApprox apa, boolean allowsFieldFlow, ApApprox innerArgApa |
1910-
returnFlowsThrough0(call, state, ccc, ap, apa, ret, p, argT, argAp, innerArgApa) and
1911-
flowThroughOutOfCall(call, ccc, ret, _, allowsFieldFlow, innerArgApa, apa) and
1909+
exists(DataFlowCall call, ApApprox apa, boolean allowsFieldFlow |
1910+
returnFlowsThrough0(call, state, ccc, ap, apa, ret, p, argT, argAp, argApa) and
1911+
flowThroughOutOfCall(call, ccc, ret, _, allowsFieldFlow, argApa, apa) and
19121912
pos = ret.getReturnPosition() and
19131913
if allowsFieldFlow = false then ap instanceof ApNil else any()
19141914
)
@@ -1920,10 +1920,10 @@ module MakeImpl<InputSig Lang> {
19201920
) {
19211921
exists(ApApprox argApa, Typ argT |
19221922
returnFlowsThrough(_, _, _, _, pragma[only_bind_into](p), pragma[only_bind_into](argT),
1923-
pragma[only_bind_into](argAp), ap) and
1923+
pragma[only_bind_into](argAp), pragma[only_bind_into](argApa), ap) and
19241924
flowIntoCallApaTaken(call, _, pragma[only_bind_into](arg), p, allowsFieldFlow, argApa) and
19251925
fwdFlow(arg, _, _, _, _, _, pragma[only_bind_into](argT), pragma[only_bind_into](argAp),
1926-
argApa) and
1926+
pragma[only_bind_into](argApa)) and
19271927
if allowsFieldFlow = false then argAp instanceof ApNil else any()
19281928
)
19291929
}
@@ -2027,7 +2027,7 @@ module MakeImpl<InputSig Lang> {
20272027
// flow out of a callable
20282028
exists(ReturnPosition pos |
20292029
revFlowOut(_, node, pos, state, _, _, _, ap) and
2030-
if returnFlowsThrough(node, pos, state, _, _, _, _, ap)
2030+
if returnFlowsThrough(node, pos, state, _, _, _, _, _, ap)
20312031
then (
20322032
returnCtx = TReturnCtxMaybeFlowThrough(pos) and
20332033
returnAp = apSome(ap)
@@ -2189,7 +2189,7 @@ module MakeImpl<InputSig Lang> {
21892189
) {
21902190
exists(RetNodeEx ret, FlowState state, CcCall ccc |
21912191
revFlowOut(call, ret, pos, state, returnCtx, _, returnAp, ap) and
2192-
returnFlowsThrough(ret, pos, state, ccc, _, _, _, ap) and
2192+
returnFlowsThrough(ret, pos, state, ccc, _, _, _, _, ap) and
21932193
matchesCall(ccc, call)
21942194
)
21952195
}
@@ -2258,15 +2258,15 @@ module MakeImpl<InputSig Lang> {
22582258
pragma[nomagic]
22592259
predicate parameterMayFlowThrough(ParamNodeEx p, Ap ap) {
22602260
exists(ReturnPosition pos |
2261-
returnFlowsThrough(_, pos, _, _, p, _, ap, _) and
2261+
returnFlowsThrough(_, pos, _, _, p, _, ap, _, _) and
22622262
parameterFlowsThroughRev(p, ap, pos, _)
22632263
)
22642264
}
22652265

22662266
pragma[nomagic]
22672267
predicate returnMayFlowThrough(RetNodeEx ret, Ap argAp, Ap ap, ReturnKindExt kind) {
22682268
exists(ParamNodeEx p, ReturnPosition pos |
2269-
returnFlowsThrough(ret, pos, _, _, p, _, argAp, ap) and
2269+
returnFlowsThrough(ret, pos, _, _, p, _, argAp, _, ap) and
22702270
parameterFlowsThroughRev(p, argAp, pos, ap) and
22712271
kind = pos.getKind()
22722272
)
@@ -3986,8 +3986,8 @@ module MakeImpl<InputSig Lang> {
39863986
AccessPath ap
39873987
) {
39883988
exists(DataFlowType t0 |
3989-
pathStep0(mid, node, state, cc, sc, t0, ap) and
3990-
Stage5::revFlow(node, state, ap.getApprox()) and
3989+
pathStep0(mid, pragma[only_bind_into](node), pragma[only_bind_into](state), cc, sc, t0, ap) and
3990+
Stage5::revFlow(pragma[only_bind_into](node), pragma[only_bind_into](state), ap.getApprox()) and
39913991
strengthenType(node, t0, t) and
39923992
not inBarrier(node, state)
39933993
)

0 commit comments

Comments
 (0)