Skip to content

Commit 5634041

Browse files
committed
Move calls to getSourceDeclaration
1 parent 43b9436 commit 5634041

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private predicate elementSpec(
287287
bindingset[namespace, type, subtypes]
288288
private RefType interpretType(string namespace, string type, boolean subtypes) {
289289
exists(RefType t |
290-
[t, t.getSourceDeclaration()].hasQualifiedName(namespace, type) and
290+
t.hasQualifiedName(namespace, type) and
291291
if subtypes = true then result.getASourceSupertype*() = t else result = t
292292
)
293293
}
@@ -409,21 +409,27 @@ private predicate outputNeedsReference(string c) {
409409
private predicate sourceElementRef(Top ref, string output, string kind) {
410410
exists(Element e |
411411
sourceElement(e, output, kind) and
412-
if outputNeedsReference(getLast(output)) then ref.(Call).getCallee() = e else ref = e
412+
if outputNeedsReference(getLast(output))
413+
then ref.(Call).getCallee().getSourceDeclaration() = e
414+
else ref = e
413415
)
414416
}
415417

416418
private predicate sinkElementRef(Top ref, string input, string kind) {
417419
exists(Element e |
418420
sinkElement(e, input, kind) and
419-
if inputNeedsReference(getLast(input)) then ref.(Call).getCallee() = e else ref = e
421+
if inputNeedsReference(getLast(input))
422+
then ref.(Call).getCallee().getSourceDeclaration() = e
423+
else ref = e
420424
)
421425
}
422426

423427
private predicate summaryElementRef(Top ref, string input, string output, string kind) {
424428
exists(Element e |
425429
summaryElement(e, input, output, kind) and
426-
if inputNeedsReference(getLast(input)) then ref.(Call).getCallee() = e else ref = e
430+
if inputNeedsReference(getLast(input))
431+
then ref.(Call).getCallee().getSourceDeclaration() = e
432+
else ref = e
427433
)
428434
}
429435

0 commit comments

Comments
 (0)