Skip to content

Commit 231bf9d

Browse files
committed
Dataflow: Drop ApApprox join in fwdFlowStore.
1 parent 501cbda commit 231bf9d

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -877,13 +877,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
877877

878878
pragma[nomagic]
879879
predicate storeStepCand(
880-
NodeEx node1, Ap ap1, Content c, NodeEx node2, DataFlowType contentType,
881-
DataFlowType containerType
880+
NodeEx node1, Content c, NodeEx node2, DataFlowType contentType, DataFlowType containerType
882881
) {
883882
revFlowIsReadAndStored(c) and
884883
revFlow(node2) and
885-
store(node1, c, node2, contentType, containerType) and
886-
exists(ap1)
884+
store(node1, c, node2, contentType, containerType)
887885
}
888886

889887
pragma[nomagic]
@@ -1292,8 +1290,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
12921290
predicate returnMayFlowThrough(RetNodeEx ret, ReturnKindExt kind);
12931291

12941292
predicate storeStepCand(
1295-
NodeEx node1, Ap ap1, Content c, NodeEx node2, DataFlowType contentType,
1296-
DataFlowType containerType
1293+
NodeEx node1, Content c, NodeEx node2, DataFlowType contentType, DataFlowType containerType
12971294
);
12981295

12991296
predicate readStepCand(NodeEx n1, Content c, NodeEx n2);
@@ -1451,7 +1448,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
14511448
pragma[nomagic]
14521449
private predicate compatibleContainer0(ApHeadContent apc, DataFlowType containerType) {
14531450
exists(DataFlowType containerType0, Content c |
1454-
PrevStage::storeStepCand(_, _, c, _, _, containerType0) and
1451+
PrevStage::storeStepCand(_, c, _, _, containerType0) and
14551452
not isTopType(containerType0) and
14561453
compatibleTypesCached(containerType0, containerType) and
14571454
apc = projectToHeadContent(c)
@@ -1461,7 +1458,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
14611458
pragma[nomagic]
14621459
private predicate topTypeContent(ApHeadContent apc) {
14631460
exists(DataFlowType containerType0, Content c |
1464-
PrevStage::storeStepCand(_, _, c, _, _, containerType0) and
1461+
PrevStage::storeStepCand(_, c, _, _, containerType0) and
14651462
isTopType(containerType0) and
14661463
apc = projectToHeadContent(c)
14671464
)
@@ -1646,11 +1643,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16461643
NodeEx node1, Typ t1, Ap ap1, TypOption stored1, Content c, Typ t2, TypOption stored2,
16471644
NodeEx node2, FlowState state, Cc cc, SummaryCtx summaryCtx
16481645
) {
1649-
exists(DataFlowType contentType, DataFlowType containerType, ApApprox apa1 |
1650-
fwdFlow(node1, state, cc, summaryCtx, t1, ap1, apa1, stored1) and
1646+
exists(DataFlowType contentType, DataFlowType containerType |
1647+
fwdFlow(node1, state, cc, summaryCtx, t1, ap1, _, stored1) and
16511648
not outBarrier(node1, state) and
16521649
not inBarrier(node2, state) and
1653-
PrevStage::storeStepCand(node1, apa1, c, node2, contentType, containerType) and
1650+
PrevStage::storeStepCand(node1, c, node2, contentType, containerType) and
16541651
t2 = getTyp(containerType) and
16551652
// We need to typecheck stores here, since reverse flow through a getter
16561653
// might have a different type here compared to inside the getter.
@@ -2443,11 +2440,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
24432440

24442441
pragma[nomagic]
24452442
predicate storeStepCand(
2446-
NodeEx node1, Ap ap1, Content c, NodeEx node2, DataFlowType contentType,
2443+
NodeEx node1, Content c, NodeEx node2, DataFlowType contentType,
24472444
DataFlowType containerType
24482445
) {
2449-
exists(Ap ap2 |
2450-
PrevStage::storeStepCand(node1, _, c, node2, contentType, containerType) and
2446+
exists(Ap ap2, Ap ap1 |
2447+
PrevStage::storeStepCand(node1, c, node2, contentType, containerType) and
24512448
revFlowStore(ap2, c, ap1, node1, _, node2, _, _) and
24522449
revFlowConsCand(ap2, c, ap1)
24532450
)
@@ -2664,7 +2661,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
26642661
or
26652662
node instanceof OutNodeEx
26662663
or
2667-
storeStepCand(_, _, _, node, _, _)
2664+
storeStepCand(_, _, node, _, _)
26682665
or
26692666
readStepCand(_, _, node)
26702667
or
@@ -2698,7 +2695,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
26982695
callEdgeReturn(_, _, node, _, next, _) and
26992696
apNext = ap
27002697
or
2701-
storeStepCand(node, _, _, next, _, _)
2698+
storeStepCand(node, _, next, _, _)
27022699
or
27032700
readStepCand(node, _, next)
27042701
)
@@ -3950,7 +3947,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
39503947
PrevStage::readStepCand(_, pragma[only_bind_into](c), _) and
39513948
c = cs.getAReadContent() and
39523949
clearSet(node, cs) and
3953-
if PrevStage::storeStepCand(_, _, _, node, _, _)
3950+
if PrevStage::storeStepCand(_, _, node, _, _)
39543951
then isStoreTarget = true
39553952
else isStoreTarget = false
39563953
)

0 commit comments

Comments
 (0)