public class

CFGVerifier

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGVerifier<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction>

Class Overview

CFG validation. Very expensive computations. Use in DEBUG mode only.

Summary

Public Constructors
CFGVerifier(CFG<InsnType> cfg)
Public Methods
void verify()
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.
Protected Methods
void customVerification(CFG<InsnType> cfg)
Custom validation method that may be overridden by subclasses which wish to validate the CFG further.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CFGVerifier (CFG<InsnType> cfg)

Public Methods

public void verify ()

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
  • the DFA is valid

Note: duplicate edges can happen at native level due to JCC-to-fallthrough.

Throws
CfgVerificationException thrown if the CFG verification failed

Protected Methods

protected void customVerification (CFG<InsnType> cfg)

Custom validation method that may be overridden by subclasses which wish to validate the CFG further. This method is called by verify() as a first validation step. The default implementation does nothing (return true).

Parameters
cfg CFG to be validated
Throws
CfgVerificationException thrown if the CFG is deemed invalid