Class Pass3bVerifier
java.lang.Object
org.apache.bcel.verifier.PassVerifier
org.apache.bcel.verifier.structurals.Pass3bVerifier
This PassVerifier verifies a method of class file according to pass 3, so-called structural verification as described in The Java Virtual Machine
Specification, 2nd edition. More detailed information is to be found at the do_verify() method's documentation.
The system property org.apache.bcel.verifier.maxFrameSlots bounds the size of the pass 3b data flow analysis, measured in frame slots:
(max_locals + max_stack) * instruction count of the method under verification. Methods above the bound are rejected instead of analyzed. The default
is 100,000,000; a value of zero or less disables the bound.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classAn InstructionContextQueue is a utility class that holds (InstructionContext, ArrayList) pairs in a Queue data structure. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanIn DEBUG mode, the verification algorithm is not randomized.private static final longprivate static final StringThe name of the system property bounding the size of the pass 3b data flow analysis, measured in frame slots:(max_locals + max_stack) * instruction countof the method under verification.private final intThe method number to verify.private final VerifierThe Verifier that created this. -
Constructor Summary
ConstructorsConstructorDescriptionPass3bVerifier(Verifier myOwner, int methodNo) This class should only be instantiated by a Verifier. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcirculationPump(MethodGen m, ControlFlowGraph cfg, InstructionContext start, Frame vanillaFrame, InstConstraintVisitor icv, ExecutionVisitor ev) Whenever the outgoing frame situation of an InstructionContext changes, all its successors are put [back] into the queue [as if they were unvisited].Pass 3b implements the data flow analysis as described in the Java Virtual Machine Specification, Second Edition.intReturns the method number as supplied when instantiating.voidinvalidReturnTypeError(Type returnedType, MethodGen m) Throws an exception indicating the returned type is not compatible with the return type of the given method.Methods inherited from class org.apache.bcel.verifier.PassVerifier
addMessage, getMessages, getMessagesList, verify
-
Field Details
-
DEBUG
private static final boolean DEBUGIn DEBUG mode, the verification algorithm is not randomized.- See Also:
-
MAX_FRAME_SLOTS_PROPERTY
The name of the system property bounding the size of the pass 3b data flow analysis, measured in frame slots:(max_locals + max_stack) * instruction countof the method under verification. Methods above the bound are rejected instead of analyzed. The default is 100,000,000; a value of zero or less disables the bound.- See Also:
-
MAX_FRAME_SLOTS
private static final long MAX_FRAME_SLOTS -
myOwner
The Verifier that created this. -
methodNo
private final int methodNoThe method number to verify.
-
-
Constructor Details
-
Pass3bVerifier
This class should only be instantiated by a Verifier.- Parameters:
myOwner- The verifier that owns this Pass3bVerifier.methodNo- The method number.- See Also:
-
-
Method Details
-
circulationPump
private void circulationPump(MethodGen m, ControlFlowGraph cfg, InstructionContext start, Frame vanillaFrame, InstConstraintVisitor icv, ExecutionVisitor ev) Whenever the outgoing frame situation of an InstructionContext changes, all its successors are put [back] into the queue [as if they were unvisited]. The proof of termination is about the existence of a fix point of frame merging. -
do_verify
Pass 3b implements the data flow analysis as described in the Java Virtual Machine Specification, Second Edition. Later versions will use LocalVariablesInfo objects to verify if the verifier-inferred types and the class file's debug information (LocalVariables attributes) match [TODO].- Specified by:
do_verifyin classPassVerifier- Returns:
- The VerificationResult.
- See Also:
-
getMethodNo
public int getMethodNo()Returns the method number as supplied when instantiating.- Returns:
- The method number.
-
invalidReturnTypeError
Throws an exception indicating the returned type is not compatible with the return type of the given method.- Parameters:
returnedType- The type of the returned expression.m- The method we are processing.- Throws:
StructuralCodeConstraintException- Always thrown.- Since:
- 6.0
-