CodeQL library for Java
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(RValue use1, RValue use2)