mirror of
https://github.com/github/codeql.git
synced 2026-02-24 10:53:49 +01:00
Java: Add MapKeyContent and MapValueContent.
This commit is contained in:
@@ -460,7 +460,7 @@ module CsvValidation {
|
||||
summaryModel(_, _, _, _, _, _, input, _, _) and pred = "summary"
|
||||
|
|
||||
specSplit(input, part, _) and
|
||||
not part.regexpMatch("|ReturnValue|ArrayElement|Element") and
|
||||
not part.regexpMatch("|ReturnValue|ArrayElement|Element|MapKey|MapValue") and
|
||||
not (part = "Argument" and pred = "sink") and
|
||||
not parseArg(part, _) and
|
||||
msg = "Unrecognized input specification \"" + part + "\" in " + pred + " model."
|
||||
@@ -472,7 +472,7 @@ module CsvValidation {
|
||||
summaryModel(_, _, _, _, _, _, _, output, _) and pred = "summary"
|
||||
|
|
||||
specSplit(output, part, _) and
|
||||
not part.regexpMatch("|ReturnValue|ArrayElement|Element") and
|
||||
not part.regexpMatch("|ReturnValue|ArrayElement|Element|MapKey|MapValue") and
|
||||
not (part = ["Argument", "Parameter"] and pred = "source") and
|
||||
not parseArg(part, _) and
|
||||
not parseParam(part, _) and
|
||||
@@ -690,10 +690,10 @@ private SummaryComponent interpretComponent(string c) {
|
||||
c = "ArrayElement" and result = SummaryComponent::content(any(ArrayContent c0))
|
||||
or
|
||||
c = "Element" and result = SummaryComponent::content(any(CollectionContent c0))
|
||||
// or
|
||||
// c = "MapKey" and result = SummaryComponent::content(any(MapKeyContent c0))
|
||||
// or
|
||||
// c = "MapValue" and result = SummaryComponent::content(any(MapValueContent c0))
|
||||
or
|
||||
c = "MapKey" and result = SummaryComponent::content(any(MapKeyContent c0))
|
||||
or
|
||||
c = "MapValue" and result = SummaryComponent::content(any(MapValueContent c0))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,10 @@ private predicate instanceFieldAssign(Expr src, FieldAccess fa) {
|
||||
|
||||
private newtype TContent =
|
||||
TFieldContent(InstanceField f) or
|
||||
TArrayContent() or
|
||||
TCollectionContent() or
|
||||
TArrayContent()
|
||||
TMapKeyContent() or
|
||||
TMapValueContent()
|
||||
|
||||
/**
|
||||
* A reference contained in an object. Examples include instance fields, the
|
||||
@@ -114,12 +116,20 @@ class FieldContent extends Content, TFieldContent {
|
||||
}
|
||||
}
|
||||
|
||||
class CollectionContent extends Content, TCollectionContent {
|
||||
override string toString() { result = "collection" }
|
||||
class ArrayContent extends Content, TArrayContent {
|
||||
override string toString() { result = "[]" }
|
||||
}
|
||||
|
||||
class ArrayContent extends Content, TArrayContent {
|
||||
override string toString() { result = "array" }
|
||||
class CollectionContent extends Content, TCollectionContent {
|
||||
override string toString() { result = "<element>" }
|
||||
}
|
||||
|
||||
class MapKeyContent extends Content, TMapKeyContent {
|
||||
override string toString() { result = "<map.key>" }
|
||||
}
|
||||
|
||||
class MapValueContent extends Content, TMapValueContent {
|
||||
override string toString() { result = "<map.value>" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user