Skip to content

Commit 543ab71

Browse files
committed
Dataflow: minor review fixes.
1 parent d28b5ac commit 543ab71

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private module Cached {
221221
compatibleTypes(getErasedNodeTypeBound(p), getErasedNodeTypeBound(node))
222222
or
223223
// getter
224-
compatibleTypes(read.getType(), getErasedNodeTypeBound(node))
224+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(node))
225225
else any()
226226
}
227227

@@ -240,7 +240,7 @@ private module Cached {
240240
// read
241241
exists(Node mid |
242242
parameterValueFlow(p, mid, TReadStepTypesNone()) and
243-
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getType()) and
243+
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getContentType()) and
244244
Cand::parameterValueFlowReturnCand(p, _, true) and
245245
compatibleTypes(getErasedNodeTypeBound(p), read.getContainerType())
246246
)
@@ -295,7 +295,7 @@ private module Cached {
295295
or
296296
// getter
297297
compatibleTypes(getErasedNodeTypeBound(arg), read.getContainerType()) and
298-
compatibleTypes(read.getType(), getErasedNodeTypeBound(out))
298+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(out))
299299
)
300300
}
301301

@@ -438,8 +438,8 @@ private predicate readStepWithTypes(
438438
Node n1, DataFlowType container, Content c, Node n2, DataFlowType content
439439
) {
440440
readStep(n1, c, n2) and
441-
container = getErasedRepr(n1.getTypeBound()) and
442-
content = getErasedRepr(n2.getTypeBound())
441+
container = getErasedNodeTypeBound(n1) and
442+
content = getErasedNodeTypeBound(n2)
443443
}
444444

445445
private newtype TReadStepTypesOption =
@@ -455,7 +455,7 @@ private class ReadStepTypesOption extends TReadStepTypesOption {
455455

456456
Content getContent() { this = TReadStepTypesSome(_, result, _) }
457457

458-
DataFlowType getType() { this = TReadStepTypesSome(_, _, result) }
458+
DataFlowType getContentType() { this = TReadStepTypesSome(_, _, result) }
459459

460460
string toString() { if this.isSome() then result = "Some(..)" else result = "None()" }
461461
}

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private module Cached {
221221
compatibleTypes(getErasedNodeTypeBound(p), getErasedNodeTypeBound(node))
222222
or
223223
// getter
224-
compatibleTypes(read.getType(), getErasedNodeTypeBound(node))
224+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(node))
225225
else any()
226226
}
227227

@@ -240,7 +240,7 @@ private module Cached {
240240
// read
241241
exists(Node mid |
242242
parameterValueFlow(p, mid, TReadStepTypesNone()) and
243-
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getType()) and
243+
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getContentType()) and
244244
Cand::parameterValueFlowReturnCand(p, _, true) and
245245
compatibleTypes(getErasedNodeTypeBound(p), read.getContainerType())
246246
)
@@ -295,7 +295,7 @@ private module Cached {
295295
or
296296
// getter
297297
compatibleTypes(getErasedNodeTypeBound(arg), read.getContainerType()) and
298-
compatibleTypes(read.getType(), getErasedNodeTypeBound(out))
298+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(out))
299299
)
300300
}
301301

@@ -438,8 +438,8 @@ private predicate readStepWithTypes(
438438
Node n1, DataFlowType container, Content c, Node n2, DataFlowType content
439439
) {
440440
readStep(n1, c, n2) and
441-
container = getErasedRepr(n1.getTypeBound()) and
442-
content = getErasedRepr(n2.getTypeBound())
441+
container = getErasedNodeTypeBound(n1) and
442+
content = getErasedNodeTypeBound(n2)
443443
}
444444

445445
private newtype TReadStepTypesOption =
@@ -455,7 +455,7 @@ private class ReadStepTypesOption extends TReadStepTypesOption {
455455

456456
Content getContent() { this = TReadStepTypesSome(_, result, _) }
457457

458-
DataFlowType getType() { this = TReadStepTypesSome(_, _, result) }
458+
DataFlowType getContentType() { this = TReadStepTypesSome(_, _, result) }
459459

460460
string toString() { if this.isSome() then result = "Some(..)" else result = "None()" }
461461
}

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private module Cached {
221221
compatibleTypes(getErasedNodeTypeBound(p), getErasedNodeTypeBound(node))
222222
or
223223
// getter
224-
compatibleTypes(read.getType(), getErasedNodeTypeBound(node))
224+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(node))
225225
else any()
226226
}
227227

@@ -240,7 +240,7 @@ private module Cached {
240240
// read
241241
exists(Node mid |
242242
parameterValueFlow(p, mid, TReadStepTypesNone()) and
243-
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getType()) and
243+
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getContentType()) and
244244
Cand::parameterValueFlowReturnCand(p, _, true) and
245245
compatibleTypes(getErasedNodeTypeBound(p), read.getContainerType())
246246
)
@@ -295,7 +295,7 @@ private module Cached {
295295
or
296296
// getter
297297
compatibleTypes(getErasedNodeTypeBound(arg), read.getContainerType()) and
298-
compatibleTypes(read.getType(), getErasedNodeTypeBound(out))
298+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(out))
299299
)
300300
}
301301

@@ -438,8 +438,8 @@ private predicate readStepWithTypes(
438438
Node n1, DataFlowType container, Content c, Node n2, DataFlowType content
439439
) {
440440
readStep(n1, c, n2) and
441-
container = getErasedRepr(n1.getTypeBound()) and
442-
content = getErasedRepr(n2.getTypeBound())
441+
container = getErasedNodeTypeBound(n1) and
442+
content = getErasedNodeTypeBound(n2)
443443
}
444444

445445
private newtype TReadStepTypesOption =
@@ -455,7 +455,7 @@ private class ReadStepTypesOption extends TReadStepTypesOption {
455455

456456
Content getContent() { this = TReadStepTypesSome(_, result, _) }
457457

458-
DataFlowType getType() { this = TReadStepTypesSome(_, _, result) }
458+
DataFlowType getContentType() { this = TReadStepTypesSome(_, _, result) }
459459

460460
string toString() { if this.isSome() then result = "Some(..)" else result = "None()" }
461461
}

java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private module Cached {
221221
compatibleTypes(getErasedNodeTypeBound(p), getErasedNodeTypeBound(node))
222222
or
223223
// getter
224-
compatibleTypes(read.getType(), getErasedNodeTypeBound(node))
224+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(node))
225225
else any()
226226
}
227227

@@ -240,7 +240,7 @@ private module Cached {
240240
// read
241241
exists(Node mid |
242242
parameterValueFlow(p, mid, TReadStepTypesNone()) and
243-
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getType()) and
243+
readStepWithTypes(mid, read.getContainerType(), read.getContent(), node, read.getContentType()) and
244244
Cand::parameterValueFlowReturnCand(p, _, true) and
245245
compatibleTypes(getErasedNodeTypeBound(p), read.getContainerType())
246246
)
@@ -295,7 +295,7 @@ private module Cached {
295295
or
296296
// getter
297297
compatibleTypes(getErasedNodeTypeBound(arg), read.getContainerType()) and
298-
compatibleTypes(read.getType(), getErasedNodeTypeBound(out))
298+
compatibleTypes(read.getContentType(), getErasedNodeTypeBound(out))
299299
)
300300
}
301301

@@ -438,8 +438,8 @@ private predicate readStepWithTypes(
438438
Node n1, DataFlowType container, Content c, Node n2, DataFlowType content
439439
) {
440440
readStep(n1, c, n2) and
441-
container = getErasedRepr(n1.getTypeBound()) and
442-
content = getErasedRepr(n2.getTypeBound())
441+
container = getErasedNodeTypeBound(n1) and
442+
content = getErasedNodeTypeBound(n2)
443443
}
444444

445445
private newtype TReadStepTypesOption =
@@ -455,7 +455,7 @@ private class ReadStepTypesOption extends TReadStepTypesOption {
455455

456456
Content getContent() { this = TReadStepTypesSome(_, result, _) }
457457

458-
DataFlowType getType() { this = TReadStepTypesSome(_, _, result) }
458+
DataFlowType getContentType() { this = TReadStepTypesSome(_, _, result) }
459459

460460
string toString() { if this.isSome() then result = "Some(..)" else result = "None()" }
461461
}

0 commit comments

Comments
 (0)