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

Predicate nullGuard

DEPRECATED: Use nullGuardControls/nullGuardControlsBranchEdge instead.

Gets a Guard that tests (possibly indirectly) whether a given SSA variable is null or not.

If result evaluates to branch, then v is guaranteed to be null if isnull is true, and non-null if isnull is false.

Import path

import semmle.code.java.dataflow.NullGuards
Guard nullGuard(SsaDefinition v, boolean branch, boolean isnull)