Skip to content

Commit 48dc9d7

Browse files
committed
C#/Java: Move containerContent to DataFlowPrivate.
1 parent b7803ef commit 48dc9d7

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,3 +2026,8 @@ abstract class SyntheticField extends string {
20262026
/** Gets the type of this synthetic field. */
20272027
Type getType() { result instanceof ObjectType }
20282028
}
2029+
2030+
/**
2031+
* Holds if the the content `c` is a container.
2032+
*/
2033+
predicate containerContent(DataFlow::Content c) { c instanceof DataFlow::ElementContent }

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,3 @@ class ElementContent extends Content, TElementContent {
252252

253253
override Location getLocation() { result instanceof EmptyLocation }
254254
}
255-
256-
/**
257-
* Holds if the the content `c` is a container.
258-
*/
259-
predicate containerContent(DataFlow::Content c) { c instanceof DataFlow::ElementContent }

csharp/ql/src/utils/model-generator/ModelGeneratorUtils.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
1414
else any()
1515
)
1616
or
17-
exists(DataFlow::Content f | storeStep(node1, f, node2) | DataFlow::containerContent(f))
17+
exists(DataFlow::Content f | storeStep(node1, f, node2) | containerContent(f))
1818
}
1919

2020
/**
@@ -24,7 +24,7 @@ predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
2424
predicate isRelevantContent(DataFlow::Content c) {
2525
isRelevantType(c.(DataFlow::FieldContent).getField().getType()) or
2626
isRelevantType(c.(DataFlow::SyntheticFieldContent).getField().getType()) or
27-
DataFlow::containerContent(c)
27+
containerContent(c)
2828
}
2929

3030
/**

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,3 +416,13 @@ private class MyConsistencyConfiguration extends Consistency::ConsistencyConfigu
416416
n.getType() instanceof ImmutableType or n instanceof ImplicitVarargsArray
417417
}
418418
}
419+
420+
/**
421+
* Holds if the the content `c` is a container.
422+
*/
423+
predicate containerContent(Content c) {
424+
c instanceof ArrayContent or
425+
c instanceof CollectionContent or
426+
c instanceof MapKeyContent or
427+
c instanceof MapValueContent
428+
}

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,6 @@ class SyntheticFieldContent extends Content, TSyntheticFieldContent {
256256
override string toString() { result = s.toString() }
257257
}
258258

259-
/**
260-
* Holds if the the content `c` is a container.
261-
*/
262-
predicate containerContent(Content c) {
263-
c instanceof ArrayContent or
264-
c instanceof CollectionContent or
265-
c instanceof MapKeyContent or
266-
c instanceof MapValueContent
267-
}
268-
269259
/**
270260
* A guard that validates some expression.
271261
*

java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private module Cached {
5454
FlowSummaryImpl::Private::Steps::summaryThroughStep(src, sink, false)
5555
or
5656
// Treat container flow as taint for the local taint flow relation
57-
exists(DataFlow::Content c | DataFlow::containerContent(c) |
57+
exists(DataFlow::Content c | containerContent(c) |
5858
readStep(src, c, sink) or
5959
storeStep(src, c, sink) or
6060
FlowSummaryImpl::Private::Steps::summaryGetterStep(src, c, sink) or
@@ -80,7 +80,7 @@ private module Cached {
8080
not sink.getTypeBound() instanceof BoxedType and
8181
not sink.getTypeBound() instanceof NumberType and
8282
(
83-
DataFlow::containerContent(f)
83+
containerContent(f)
8484
or
8585
f instanceof TaintInheritingContent
8686
)

java/ql/src/utils/model-generator/ModelGeneratorUtils.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
1414
else any()
1515
)
1616
or
17-
exists(DataFlow::Content f | storeStep(node1, f, node2) | DataFlow::containerContent(f))
17+
exists(DataFlow::Content f | storeStep(node1, f, node2) | containerContent(f))
1818
}
1919

2020
/**
@@ -24,7 +24,7 @@ predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
2424
predicate isRelevantContent(DataFlow::Content c) {
2525
isRelevantType(c.(DataFlow::FieldContent).getField().getType()) or
2626
isRelevantType(c.(DataFlow::SyntheticFieldContent).getField().getType()) or
27-
DataFlow::containerContent(c)
27+
containerContent(c)
2828
}
2929

3030
/**

0 commit comments

Comments
 (0)