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

Predicate useUsePair

Holds if use1 and use2 form a use-use-pair of the same SsaSourceVariable, that is, the value read in use1 can reach use2 without passing through any SSA definition of the variable except for phi nodes and uncertain implicit updates.

This is the transitive closure of adjacentUseUse.

Import path

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