CodeQL library for Java/Kotlin
codeql/java-all 0.9.1 (changelog, source)
Search

Predicate useUsePairSameVar

Holds if use1 and use2 form a use-use-pair of the same SSA variable, that is, the value read in use1 can reach use2 without passing through any SSA definition of the variable.

This is the transitive closure of adjacentUseUseSameVar.

Import path

import semmle.code.java.dataflow.DefUse
predicate useUsePairSameVar(VarRead use1, VarRead use2)