# Class: com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGVerifier
- Type Parameter: InsnType extends `com.pnfsoftware.jeb.core.units.code.IInstruction`

- Super class: `java.lang.Object`

Verifier of control flow graphs. Verification is expensive: this class should be reserved for  test cases or debug mode.

## Constructor: CFGVerifier
- parameter: `cfg`, type: `com.pnfsoftware.jeb.core.units.code.asm.cfg.CFG<InsnType>`

Description: Create a CFG verifier.
parameter: cfg: CFG to verify

## Protected Field: cfg
Type: `com.pnfsoftware.jeb.core.units.code.asm.cfg.CFG<InsnType>`

## Protected Method: customVerification
- throws: `com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGVerificationException`

Description: Custom validation method that may be overridden by subclasses which wish to validate the CFG  further. This method is called by [#verify()](#verify()) as a first validation step. The default  implementation does nothing \(return true\).
throws: thrown if the CFG is deemed invalid

## Protected Method: shouldExpectFallthrough
- parameter: `insn`, type: `InsnType`
- return type: `boolean`

Description: Determine whether an instruction is expected to fall through.
parameter: insn: instruction
return: true if fallthrough is expected

## Method: verify
- throws: `com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGVerificationException`

Description: A CFG is considered valid if:  
  
- there is only one \(or none\) branching instruction per basic block, located at its end  \(taking into account the possible delay\-slot\)  
- the branching instructions are synchronized with the edges, i.e. they both represent the  same information **in the same order** \(fallthrough first\)  
- there is no duplicate edges  

  

  Note: duplicate edges can happen at native level due to JCC\-to\-fallthrough.
throws: thrown if the CFG verification failed

