Java: Support Argument[this] in framework mode metadata extraction

This commit is contained in:
Stephan Brandauer
2023-07-26 17:21:43 +02:00
parent 499bd970d3
commit 09c64e8fee

View File

@@ -125,13 +125,19 @@ class FrameworkModeMetadataExtractor extends string {
string input, string parameterName
) {
exists(Callable callable, int paramIdx |
e.asParameter() = callable.getParameter(paramIdx) and
(
e.(DataFlow::ExplicitParameterNode).asParameter() = callable.getParameter(paramIdx) and
parameterName = e.asParameter().getName()
or
e.(DataFlow::InstanceParameterNode).getCallable() = callable and
paramIdx = -1 and
parameterName = "this"
) and
input = AutomodelJavaUtil::getArgumentForIndex(paramIdx) and
package = callable.getDeclaringType().getPackage().getName() and
type = callable.getDeclaringType().getErasure().(RefType).nestedName() and
subtypes = AutomodelJavaUtil::considerSubtypes(callable).toString() and
name = callable.getName() and
parameterName = e.asParameter().getName() and
signature = ExternalFlow::paramsString(callable)
)
}