Skip to content

Commit 79b1cd7

Browse files
committed
Dataflow: Refactor getLocalCc to avoid reference to NodeEx.
1 parent eb0b923 commit 79b1cd7

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,8 +1390,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
13901390
bindingset[call, c]
13911391
CcNoCall getCallContextReturn(DataFlowCallable c, DataFlowCall call);
13921392

1393-
bindingset[node, cc]
1394-
LocalCc getLocalCc(NodeEx node, Cc cc);
1393+
bindingset[c, cc]
1394+
LocalCc getLocalCc(DataFlowCallable c, Cc cc);
13951395

13961396
bindingset[node1, state1]
13971397
bindingset[node2, state2]
@@ -1480,7 +1480,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
14801480
or
14811481
exists(NodeEx mid, FlowState state0, Typ t0, LocalCc localCc |
14821482
fwdFlow(mid, state0, cc, summaryCtx, argT, argAp, t0, ap, apa) and
1483-
localCc = getLocalCc(mid, cc)
1483+
localCc = getLocalCc(mid.getEnclosingCallable(), cc)
14841484
|
14851485
localStep(mid, state0, node, state, true, _, localCc) and
14861486
t = t0
@@ -2533,8 +2533,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25332533

25342534
class LocalCc = Unit;
25352535

2536-
bindingset[node, cc]
2537-
LocalCc getLocalCc(NodeEx node, Cc cc) { any() }
2536+
bindingset[c, cc]
2537+
LocalCc getLocalCc(DataFlowCallable c, Cc cc) { any() }
25382538

25392539
DataFlowCallable viableImplCallContextReduced(DataFlowCall call, CcCall ctx) { none() }
25402540

@@ -2595,8 +2595,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25952595
module NoLocalCallContext {
25962596
class LocalCc = Unit;
25972597

2598-
bindingset[node, cc]
2599-
LocalCc getLocalCc(NodeEx node, Cc cc) { any() }
2598+
bindingset[c, cc]
2599+
LocalCc getLocalCc(DataFlowCallable c, Cc cc) { any() }
26002600

26012601
bindingset[call, c]
26022602
CcCall getCallContextCall(DataFlowCall call, DataFlowCallable c) {
@@ -2609,11 +2609,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
26092609
module LocalCallContext {
26102610
class LocalCc = LocalCallContext;
26112611

2612-
bindingset[node, cc]
2613-
LocalCc getLocalCc(NodeEx node, Cc cc) {
2614-
result =
2615-
getLocalCallContext(pragma[only_bind_into](pragma[only_bind_out](cc)),
2616-
node.getEnclosingCallable())
2612+
bindingset[c, cc]
2613+
LocalCc getLocalCc(DataFlowCallable c, Cc cc) {
2614+
result = getLocalCallContext(pragma[only_bind_into](pragma[only_bind_out](cc)), c)
26172615
}
26182616

26192617
bindingset[call, c]

0 commit comments

Comments
 (0)