Skip to content

Commit b2d42ee

Browse files
committed
Dataflow: Rename two predicates to remove need for alias defs.
1 parent e0cb70a commit b2d42ee

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
351351
/**
352352
* Holds if data can flow from `node1` to `node2` in a way that discards call contexts.
353353
*/
354-
private predicate jumpStepEx(NodeEx node1, NodeEx node2) {
354+
private predicate jumpStepEx1(NodeEx node1, NodeEx node2) {
355355
exists(Node n1, Node n2 |
356356
node1.asNode() = n1 and
357357
node2.asNode() = n2 and
@@ -364,7 +364,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
364364
/**
365365
* Holds if the additional step from `node1` to `node2` jumps between callables.
366366
*/
367-
private predicate additionalJumpStep(NodeEx node1, NodeEx node2, string model) {
367+
private predicate additionalJumpStep1(NodeEx node1, NodeEx node2, string model) {
368368
exists(Node n1, Node n2 |
369369
node1.asNodeOrImplicitRead() = n1 and
370370
node2.asNode() = n2 and
@@ -478,8 +478,8 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
478478
)
479479
or
480480
exists(NodeEx mid | fwdFlow(mid, _) and cc = false |
481-
jumpStepEx(mid, node) or
482-
additionalJumpStep(mid, node, _) or
481+
jumpStepEx1(mid, node) or
482+
additionalJumpStep1(mid, node, _) or
483483
additionalJumpStateStep(mid, _, node, _, _)
484484
)
485485
or
@@ -693,8 +693,8 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
693693
)
694694
or
695695
exists(NodeEx mid | revFlow(mid, _) and toReturn = false |
696-
jumpStepEx(node, mid) or
697-
additionalJumpStep(node, mid, _) or
696+
jumpStepEx1(node, mid) or
697+
additionalJumpStep1(node, mid, _) or
698698
additionalJumpStateStep(node, _, mid, _, _)
699699
)
700700
or
@@ -1212,11 +1212,6 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
12121212
)
12131213
}
12141214

1215-
private predicate jumpStepExAlias = jumpStepEx/2;
1216-
1217-
private predicate additionalJumpStepAlias = additionalJumpStep/3;
1218-
1219-
12201215
module Stage1NoState implements Stage1Output<Unit> {
12211216
class Nd = NodeEx;
12221217

@@ -1255,9 +1250,9 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
12551250

12561251
predicate sinkNode(NodeEx node) { sinkNode(node, _) }
12571252

1258-
predicate jumpStepEx = jumpStepExAlias/2;
1253+
predicate jumpStepEx = jumpStepEx1/2;
12591254

1260-
predicate additionalJumpStep = additionalJumpStepAlias/3;
1255+
predicate additionalJumpStep = additionalJumpStep1/3;
12611256

12621257
predicate localStep1 = localStepNodeCand1/6;
12631258

@@ -1280,8 +1275,8 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
12801275
exists(NodeEx mid | flowState(mid, state) |
12811276
localFlowStepEx(mid, node, _) or
12821277
additionalLocalFlowStep(mid, node, _) or
1283-
jumpStepExAlias(mid, node) or
1284-
additionalJumpStepAlias(mid, node, _) or
1278+
jumpStepEx1(mid, node) or
1279+
additionalJumpStep1(mid, node, _) or
12851280
store(mid, _, node, _, _) or
12861281
readSetEx(mid, _, node) or
12871282
flowIntoCallNodeCand1(_, mid, node) or
@@ -1437,7 +1432,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
14371432

14381433
predicate jumpStepEx(Nd node1, Nd node2) {
14391434
exists(NodeEx n1, NodeEx n2, FlowState s |
1440-
jumpStepExAlias(n1, n2) and
1435+
jumpStepEx1(n1, n2) and
14411436
node1 = TNodeState(n1, pragma[only_bind_into](s)) and
14421437
node2 = TNodeState(n2, pragma[only_bind_into](s)) and
14431438
not outBarrier(n1, s) and
@@ -1447,7 +1442,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
14471442

14481443
predicate additionalJumpStep(Nd node1, Nd node2, string model) {
14491444
exists(NodeEx n1, NodeEx n2, FlowState s |
1450-
additionalJumpStepAlias(n1, n2, model) and
1445+
additionalJumpStep1(n1, n2, model) and
14511446
node1 = TNodeState(n1, pragma[only_bind_into](s)) and
14521447
node2 = TNodeState(n2, pragma[only_bind_into](s)) and
14531448
not outBarrier(n1, s) and
@@ -1529,9 +1524,9 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
15291524

15301525
private predicate callableStep(DataFlowCallable c1, DataFlowCallable c2) {
15311526
exists(NodeEx node1, NodeEx node2 |
1532-
jumpStepEx(node1, node2)
1527+
jumpStepEx1(node1, node2)
15331528
or
1534-
additionalJumpStep(node1, node2, _)
1529+
additionalJumpStep1(node1, node2, _)
15351530
or
15361531
additionalJumpStateStep(node1, _, node2, _, _)
15371532
or
@@ -2012,7 +2007,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
20122007
) and
20132008
isStoreStep = false
20142009
or
2015-
jumpStepEx(mid.getNodeEx(), node) and
2010+
jumpStepEx1(mid.getNodeEx(), node) and
20162011
state = mid.getState() and
20172012
cc = callContextNone() and
20182013
sc1 = TSummaryCtx1None() and
@@ -2023,7 +2018,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
20232018
ap = mid.getAp() and
20242019
isStoreStep = false
20252020
or
2026-
additionalJumpStep(mid.getNodeEx(), node, _) and
2021+
additionalJumpStep1(mid.getNodeEx(), node, _) and
20272022
state = mid.getState() and
20282023
cc = callContextNone() and
20292024
sc1 = TSummaryCtx1None() and
@@ -2314,15 +2309,15 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
23142309
ap = TPartialNil() and
23152310
isStoreStep = false
23162311
or
2317-
jumpStepEx(node, mid.getNodeEx()) and
2312+
jumpStepEx1(node, mid.getNodeEx()) and
23182313
state = mid.getState() and
23192314
sc1 = TRevSummaryCtx1None() and
23202315
sc2 = TRevSummaryCtx2None() and
23212316
sc3 = TRevSummaryCtx3None() and
23222317
ap = mid.getAp() and
23232318
isStoreStep = false
23242319
or
2325-
additionalJumpStep(node, mid.getNodeEx(), _) and
2320+
additionalJumpStep1(node, mid.getNodeEx(), _) and
23262321
state = mid.getState() and
23272322
sc1 = TRevSummaryCtx1None() and
23282323
sc2 = TRevSummaryCtx2None() and

0 commit comments

Comments
 (0)