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

Predicate CaptureInput::getImmediateBasicBlockDominator

Gets the basic block that immediately dominates basic block bb, if any.

That is, all paths reaching bb from some entry point basic block must go through the result.

Example:

int M(string s) {
  if (s == null)
    throw new ArgumentNullException(nameof(s));
  return s.Length;
}

The basic block starting on line 2 is an immediate dominator of the basic block on line 4 (all paths from the entry point of M to return s.Length; must go through the null check.

Import path

import semmle.code.java.dataflow.internal.DataFlowPrivate
BasicBlock getImmediateBasicBlockDominator(BasicBlock bb)