add support for the Argument[any] and Argument[any-named] tokens

This commit is contained in:
Erik Krogh Kristensen
2022-04-27 22:49:43 +02:00
parent b1fa7f86a8
commit a8790412dd
2 changed files with 14 additions and 8 deletions

View File

@@ -92,12 +92,19 @@ API::Node getExtraSuccessorFromInvoke(API::CallNode node, AccessPathToken token)
token.getName() = "Instance" and
result = node.getReturn()
or
token.getName() = "Argument" and
token.getAnArgument() = "self" and
result = node.getSelfParameter()
or
token.getName() = "Argument" and
exists(string arg | arg + ":" = token.getAnArgument() | result = node.getKeywordParameter(arg))
token.getName() = ["Argument", "Parameter"] and
(
token.getAnArgument() = "self" and
result = node.getSelfParameter()
or
token.getAnArgument() = "any" and
result = [node.getParameter(_), node.getKeywordParameter(_)]
or
token.getAnArgument() = "any-named" and
result = node.getKeywordParameter(_)
or
exists(string arg | arg + ":" = token.getAnArgument() | result = node.getKeywordParameter(arg))
)
}
/**

View File

@@ -58,8 +58,7 @@ class Sinks extends ModelInput::SinkModelCsv {
}
}
// TODO: Any argument
// TODO: Test taint steps.
// TODO: Test taint steps (include that the base path may end with ".Call")
// TODO: // There are no API-graph edges for: ArrayElement, Element, MapKey, MapValue (remove from valid tokens list)
class Sources extends ModelInput::SourceModelCsv {
// package;type;path;kind