mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Consider bulk-like data for argument accessors
This commit is contained in:
@@ -228,10 +228,6 @@ predicate isRelevantType(Type t) {
|
||||
)
|
||||
}
|
||||
|
||||
predicate isPrimitiveTypeUsedForBulkData(Type t) {
|
||||
t.getName().regexpMatch("byte|char|Byte|Character")
|
||||
}
|
||||
|
||||
from TargetAPI api, string flow
|
||||
where flow = captureFlow(api)
|
||||
select flow order by flow
|
||||
|
||||
@@ -102,10 +102,16 @@ private string typeAsModel(RefType type) {
|
||||
}
|
||||
|
||||
string parameterAccess(Parameter p) {
|
||||
if p.getType() instanceof Array
|
||||
if
|
||||
p.getType() instanceof Array and
|
||||
not isPrimitiveTypeUsedForBulkData(p.getType().(Array).getElementType())
|
||||
then result = "ArrayElement of Argument[" + p.getPosition() + "]"
|
||||
else
|
||||
if p.getType() instanceof ContainerType
|
||||
then result = "Element of Argument[" + p.getPosition() + "]"
|
||||
else result = "Argument[" + p.getPosition() + "]"
|
||||
}
|
||||
|
||||
predicate isPrimitiveTypeUsedForBulkData(Type t) {
|
||||
t.getName().regexpMatch("byte|char|Byte|Character")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user