Skip to content

Commit 2536be0

Browse files
committed
Address review comments
1 parent 4474e25 commit 2536be0

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
631631

632632
private newtype TSummaryCtx =
633633
TSummaryCtxNone() or
634-
TSummaryCtxSome(ParamNd p, Typ t, Ap ap, TypOption stored, Boolean mustReturn) {
634+
TSummaryCtxSome(ParamNd p, Typ t, Ap ap, TypOption stored, boolean mustReturn) {
635635
fwdFlowInFlowThrough(p, _, t, ap, stored, mustReturn)
636636
} or
637637
TSummaryCtxSource(Boolean mustEscape)
@@ -1019,9 +1019,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
10191019
private predicate fwdFlowInFlowThrough(
10201020
ParamNd p, CcCall innercc, Typ t, Ap ap, TypOption stored, boolean mustReturn
10211021
) {
1022-
exists(SummaryCtx outerSummaryCtx |
1023-
FwdFlowInThrough::fwdFlowIn(_, _, _, p, _, innercc, outerSummaryCtx, t, ap, stored, _) and
1024-
outerSummaryCtx.isValidForFlowThrough(mustReturn)
1022+
exists(SummaryCtx summaryCtx |
1023+
FwdFlowInThrough::fwdFlowIn(_, _, _, p, _, innercc, summaryCtx, t, ap, stored, _) and
1024+
summaryCtx.isValidForFlowThrough(mustReturn)
10251025
)
10261026
}
10271027

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
4747
}
4848
}
4949

50-
newtype TFlowFeature =
50+
private newtype TFlowFeature =
5151
TFeatureHasSourceCallContext() or
5252
TFeatureHasSinkCallContext() or
5353
TFeatureEqualSourceSinkCallContext() or
54-
TFeatureEscapesSourceCallContext(Boolean strict)
54+
TFeatureEscapesSourceCallContext() or
55+
TFeatureEscapesSourceCallContextOrEqualSourceSinkCallContext()
5556

5657
/** A flow configuration feature for use in `Configuration::getAFeature()`. */
5758
class FlowFeature extends TFlowFeature {
@@ -89,22 +90,16 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
8990
* the sink.
9091
*/
9192
class FeatureEscapesSourceCallContext extends FlowFeature, TFeatureEscapesSourceCallContext {
92-
FeatureEscapesSourceCallContext() { this = TFeatureEscapesSourceCallContext(true) }
93-
9493
override string toString() { result = "FeatureEscapesSourceCallContext" }
9594
}
9695

9796
/**
98-
* A flow configuration feature that is the disjuction of `FeatureEscapesSourceCallContext`
97+
* A flow configuration feature that is the disjunction of `FeatureEscapesSourceCallContext`
9998
* and `FeatureEqualSourceSinkCallContext`.
10099
*/
101100
class FeatureEscapesSourceCallContextOrEqualSourceSinkCallContext extends FlowFeature,
102-
TFeatureEscapesSourceCallContext
101+
TFeatureEscapesSourceCallContextOrEqualSourceSinkCallContext
103102
{
104-
FeatureEscapesSourceCallContextOrEqualSourceSinkCallContext() {
105-
this = TFeatureEscapesSourceCallContext(false)
106-
}
107-
108103
override string toString() {
109104
result = "FeatureEscapesSourceCallContextOrEqualSourceSinkCallContext"
110105
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,10 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
10191019
}
10201020

10211021
predicate hasFeatureEscapesSourceCallContext(boolean strict) {
1022-
Config::getAFeature() = TFeatureEscapesSourceCallContext(strict)
1022+
Config::getAFeature() instanceof FeatureEscapesSourceCallContext and strict = true
1023+
or
1024+
Config::getAFeature() instanceof FeatureEscapesSourceCallContextOrEqualSourceSinkCallContext and
1025+
strict = false
10231026
}
10241027

10251028
predicate hasSinkCallCtx() {

0 commit comments

Comments
 (0)