CodeQL library for Ruby
codeql/ruby-all 4.1.2-dev (changelog, source)
Search

Member predicate BasicBlock::immediatelyDominates

Holds if this basic block immediately dominates basic block bb.

That is, this basic block is the unique basic block satisfying:

  1. This basic block strictly dominates bb
  2. There exists no other basic block that is strictly dominated by this basic block and which strictly dominates bb.

All basic blocks, except entry basic blocks, have a unique immediate dominator.

Example:

def m b
  if b
    return 0
  end
  return 1
end

The basic block starting on line 2 immediately dominates the basic block on line 5 (all paths from the entry point of m to return 1 must go through the if block).

predicate immediatelyDominates(BasicBlock bb)