diff --git a/java/ql/lib/semmle/code/java/controlflow/Guards.qll b/java/ql/lib/semmle/code/java/controlflow/Guards.qll index 778ebe6e878..a3cffbae459 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Guards.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Guards.qll @@ -141,6 +141,7 @@ private predicate isNonFallThroughPredecessor(SwitchCase sc, ControlFlowNode pre private module GuardsInput implements SharedGuards::InputSig { private import java as J + private import semmle.code.java.dataflow.internal.BaseSSA private import semmle.code.java.dataflow.NullGuards as NullGuards import SuccessorType @@ -216,6 +217,12 @@ private module GuardsInput implements SharedGuards::InputSig { f.isFinal() and f.getInitializer() = NullGuards::baseNotNullExpr() ) + or + exists(CatchClause cc, LocalVariableDeclExpr decl, BaseSsaUpdate v | + decl = cc.getVariable() and + decl = v.getDefiningExpr() and + this = v.getAUse() + ) } }