Skip to content

Commit 17e0cc5

Browse files
authored
Merge pull request #16313 from hvitved/dataflow/fix-bad-join3
Data flow: Fix bad join
2 parents f29d2c2 + 95d579d commit 17e0cc5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,14 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
11421142
)
11431143
}
11441144

1145+
pragma[nomagic]
1146+
private predicate returnCallEdgeInCtx1(
1147+
DataFlowCallable c, SndLevelScopeOption scope, DataFlowCall call, NodeEx out, DataFlowCall ctx
1148+
) {
1149+
returnCallEdge1(c, scope, call, out) and
1150+
c = viableImplInCallContextExt(call, ctx)
1151+
}
1152+
11451153
private int ctxDispatchFanoutOnReturn(NodeEx out, DataFlowCall ctx) {
11461154
exists(DataFlowCall call, DataFlowCallable c |
11471155
simpleDispatchFanoutOnReturn(call, out) > 1 and
@@ -1151,8 +1159,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
11511159
mayBenefitFromCallContextExt(call, _) and
11521160
result =
11531161
count(DataFlowCallable tgt, SndLevelScopeOption scope |
1154-
tgt = viableImplInCallContextExt(call, ctx) and
1155-
returnCallEdge1(tgt, scope, call, out)
1162+
returnCallEdgeInCtx1(tgt, scope, call, out, ctx)
11561163
)
11571164
)
11581165
}

0 commit comments

Comments
 (0)