Skip to content

Commit d638b5c

Browse files
committed
Sync shared file
1 parent f6ec56a commit d638b5c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

java/ql/src/utils/modelgenerator/internal/CaptureModels.qll

+8-10
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,30 @@ module Printing = ModelPrinting<ModelPrintingInput>;
5050
/**
5151
* Holds if `c` is a relevant content kind, where the underlying type is relevant.
5252
*/
53-
private predicate isRelevantTypeInContent(DataFlow::Content c) {
53+
private predicate isRelevantTypeInContent(DataFlow::ContentSet c) {
5454
isRelevantType(getUnderlyingContentType(c))
5555
}
5656

5757
/**
5858
* Holds if data can flow from `node1` to `node2` either via a read or a write of an intermediate field `f`.
5959
*/
6060
private predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
61-
exists(DataFlow::Content f |
61+
exists(DataFlow::ContentSet f |
6262
DataFlowPrivate::readStep(node1, f, node2) and
6363
// Partially restrict the content types used for intermediate steps.
6464
(not exists(getUnderlyingContentType(f)) or isRelevantTypeInContent(f))
6565
)
6666
or
67-
exists(DataFlow::Content f | DataFlowPrivate::storeStep(node1, f, node2) |
68-
DataFlowPrivate::containerContent(f)
69-
)
67+
exists(DataFlow::ContentSet f | DataFlowPrivate::storeStep(node1, f, node2) | containerContent(f))
7068
}
7169

7270
/**
7371
* Holds if content `c` is either a field, a synthetic field or language specific
7472
* content of a relevant type or a container like content.
7573
*/
76-
private predicate isRelevantContent(DataFlow::Content c) {
74+
private predicate isRelevantContent(DataFlow::ContentSet c) {
7775
isRelevantTypeInContent(c) or
78-
DataFlowPrivate::containerContent(c)
76+
containerContent(c)
7977
}
8078

8179
/**
@@ -170,8 +168,8 @@ module PropagateFlowConfig implements DataFlow::StateConfigSig {
170168
predicate isAdditionalFlowStep(
171169
DataFlow::Node node1, FlowState state1, DataFlow::Node node2, FlowState state2
172170
) {
173-
exists(DataFlow::Content c |
174-
DataFlowImplCommon::store(node1, c, node2, _, _) and
171+
exists(DataFlow::ContentSet c |
172+
DataFlowImplCommon::store(node1, c.getAStoreContent(), node2, _, _) and
175173
isRelevantContent(c) and
176174
(
177175
state1 instanceof TaintRead and state2.(TaintStore).getStep() = 1
@@ -180,7 +178,7 @@ module PropagateFlowConfig implements DataFlow::StateConfigSig {
180178
)
181179
)
182180
or
183-
exists(DataFlow::Content c |
181+
exists(DataFlow::ContentSet c |
184182
DataFlowPrivate::readStep(node1, c, node2) and
185183
isRelevantContent(c) and
186184
state1.(TaintRead).getStep() + 1 = state2.(TaintRead).getStep()

java/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll

+2
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,5 @@ predicate isRelevantSinkKind(string kind) {
303303
*/
304304
bindingset[kind]
305305
predicate isRelevantSourceKind(string kind) { any() }
306+
307+
predicate containerContent = DataFlowPrivate::containerContent/1;

0 commit comments

Comments
 (0)