Class CFGVerifier<InsnType extends IInstruction>
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGVerifier<InsnType>
- Type Parameters:
InsnType
-
Verifier of control flow graphs. Verification is expensive: this class should be reserved for test cases or debug-mode.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Custom validation method that may be overridden by subclasses which wish to validate the CFG further.protected boolean
void
verify()
A CFG is considered valid if:
-
Field Details
-
cfg
-
-
Constructor Details
-
CFGVerifier
-
-
Method Details
-
customVerification
Custom validation method that may be overridden by subclasses which wish to validate the CFG further. This method is called byverify()
as a first validation step. The default implementation does nothing (return true).- Throws:
CfgVerificationException
- thrown if the CFG is deemed invalid
-
shouldExpectFallthrough
- Parameters:
insn
-- Returns:
-
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
Note: duplicate edges can happen at native level due to JCC-to-fallthrough.
- Throws:
CfgVerificationException
- thrown if the CFG verification failed
-