Skip to content

Commit f310780

Browse files
committed
Dataflow: Simplify the call-edge join in reverse through-flow.
1 parent 133e269 commit f310780

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Diff for: shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

+14-12
Original file line numberDiff line numberDiff line change
@@ -2187,11 +2187,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
21872187

21882188
pragma[nomagic]
21892189
private predicate flowThroughIntoCall(
2190-
DataFlowCall call, ArgNodeEx arg, ParamNodeEx p, Ap argAp, Ap ap
2190+
DataFlowCall call, ArgNodeEx arg, ParamNodeEx p, Ap argAp
21912191
) {
21922192
exists(Typ argT, TypOption argStored |
21932193
returnFlowsThrough(_, _, _, _, pragma[only_bind_into](p), pragma[only_bind_into](argT),
2194-
pragma[only_bind_into](argAp), pragma[only_bind_into](argStored), ap) and
2194+
pragma[only_bind_into](argAp), pragma[only_bind_into](argStored), _) and
21952195
flowIntoCallTaken(call, _, pragma[only_bind_into](arg), p, isNil(argAp)) and
21962196
fwdFlow(arg, _, _, _, pragma[only_bind_into](argT), pragma[only_bind_into](argAp),
21972197
pragma[only_bind_into](argStored))
@@ -2285,9 +2285,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
22852285
returnAp = apNone()
22862286
or
22872287
// flow through a callable
2288-
exists(DataFlowCall call, ParamNodeEx p, Ap innerReturnAp |
2289-
revFlowThrough(call, returnCtx, p, state, _, returnAp, ap, innerReturnAp) and
2290-
flowThroughIntoCall(call, node, p, ap, innerReturnAp)
2288+
exists(DataFlowCall call, ParamNodeEx p |
2289+
revFlowThrough(call, returnCtx, p, state, returnAp, ap) and
2290+
flowThroughIntoCall(call, node, p, ap)
22912291
)
22922292
or
22932293
// flow out of a callable
@@ -2437,11 +2437,13 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
24372437

24382438
pragma[nomagic]
24392439
private predicate revFlowThrough(
2440-
DataFlowCall call, ReturnCtx returnCtx, ParamNodeEx p, FlowState state,
2441-
ReturnPosition pos, ApOption returnAp, Ap ap, Ap innerReturnAp
2440+
DataFlowCall call, ReturnCtx returnCtx, ParamNodeEx p, FlowState state, ApOption returnAp,
2441+
Ap ap
24422442
) {
2443-
revFlowParamToReturn(p, state, pos, innerReturnAp, ap) and
2444-
revFlowIsReturned(call, returnCtx, returnAp, pos, innerReturnAp)
2443+
exists(ReturnPosition pos, Ap innerReturnAp |
2444+
revFlowParamToReturn(p, state, pos, innerReturnAp, ap) and
2445+
revFlowIsReturned(call, returnCtx, returnAp, pos, innerReturnAp)
2446+
)
24452447
}
24462448

24472449
/**
@@ -2567,9 +2569,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25672569
DataFlowCall call, ArgNodeEx arg, FlowState state, ReturnCtx returnCtx, ApOption returnAp,
25682570
Ap ap
25692571
) {
2570-
exists(ParamNodeEx p, Ap innerReturnAp |
2571-
revFlowThrough(call, returnCtx, p, state, _, returnAp, ap, innerReturnAp) and
2572-
flowThroughIntoCall(call, arg, p, ap, innerReturnAp)
2572+
exists(ParamNodeEx p |
2573+
revFlowThrough(call, returnCtx, p, state, returnAp, ap) and
2574+
flowThroughIntoCall(call, arg, p, ap)
25732575
)
25742576
}
25752577

0 commit comments

Comments
 (0)