Skip to content

Commit f7932dc

Browse files
committed
Dataflow: Postpone type pruning until stage 5.
1 parent 0225509 commit f7932dc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3929,15 +3929,15 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
39293929
private module Stage4Param implements MkStage<Stage3>::StageParam {
39303930
private module PrevStage = Stage3;
39313931

3932-
class Typ = DataFlowType;
3932+
class Typ = Unit;
39333933

39343934
class Ap = AccessPathFront;
39353935

39363936
class ApNil = AccessPathFrontNil;
39373937

39383938
PrevStage::Ap getApprox(Ap ap) { result = ap.toApprox() }
39393939

3940-
Typ getTyp(DataFlowType t) { result = t }
3940+
Typ getTyp(DataFlowType t) { any() }
39413941

39423942
bindingset[c, tail]
39433943
Ap apCons(Content c, Ap tail) { result.getHead() = c and exists(tail) }
@@ -3962,9 +3962,10 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
39623962
NodeEx node1, FlowState state1, NodeEx node2, FlowState state2, boolean preservesValue,
39633963
Typ t, LocalCc lcc, string label
39643964
) {
3965-
Stage3Param::localFlowBigStep(node1, state1, node2, state2, preservesValue, t, _, label) and
3965+
Stage3Param::localFlowBigStep(node1, state1, node2, state2, preservesValue, _, _, label) and
39663966
PrevStage::revFlow(node1, pragma[only_bind_into](state1), _) and
39673967
PrevStage::revFlow(node2, pragma[only_bind_into](state2), _) and
3968+
exists(t) and
39683969
exists(lcc)
39693970
}
39703971

@@ -4013,7 +4014,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
40134014
predicate filter(NodeEx node, FlowState state, Typ t0, Ap ap, Typ t) {
40144015
exists(state) and
40154016
not clear(node, ap) and
4016-
strengthenType(node, t0, t) and
4017+
t0 = t and
40174018
(
40184019
notExpectsContent(node)
40194020
or
@@ -4027,7 +4028,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
40274028
}
40284029

40294030
bindingset[t1, t2]
4030-
predicate typecheck(Typ t1, Typ t2) { compatibleTypesFilter(t1, t2) }
4031+
predicate typecheck(Typ t1, Typ t2) { any() }
40314032
}
40324033

40334034
private module Stage4 = MkStage<Stage3>::Stage<Stage4Param>;

0 commit comments

Comments
 (0)