Skip to content

Commit 6793bc6

Browse files
committed
Java: Exclude qualifier argument for existing models
Excludes candadites for `Argument[this]` where we already have a model that covers a different argument of the containing call.
1 parent 9193de6 commit 6793bc6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,10 @@ private class OtherArgumentToModeledMethodCharacteristic extends Characteristics
329329

330330
override predicate appliesToEndpoint(Endpoint e) {
331331
not ApplicationCandidatesImpl::isSink(e, _) and
332-
exists(DataFlow::Node otherSink |
332+
exists(DataFlow::Node otherSink, Call c |
333333
ApplicationCandidatesImpl::isSink(otherSink, _) and
334-
e.asExpr() = otherSink.asExpr().(Argument).getCall().getAnArgument() and
334+
c = otherSink.asExpr().(Argument).getCall() and
335+
e.asExpr() in [c.getQualifier(), c.getAnArgument()] and
335336
e != otherSink
336337
)
337338
}

0 commit comments

Comments
 (0)