Package org.apache.bcel.verifier.statics
Class Pass3aVerifier.InstOperandConstraintVisitor
java.lang.Object
org.apache.bcel.generic.EmptyVisitor
org.apache.bcel.verifier.statics.Pass3aVerifier.InstOperandConstraintVisitor
- All Implemented Interfaces:
Visitor
- Enclosing class:
- Pass3aVerifier
This visitor class does the actual checking for the instruction operand's constraints.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConstantPoolGenThe ConstantPoolGen instance this Visitor operates on. -
Constructor Summary
ConstructorsConstructorDescriptionInstOperandConstraintVisitor(ConstantPoolGen constantPoolGen) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidconstraintViolated(Instruction i, String message) A utility method to always raise an exception.private MethodgetMethod(JavaClass jc, InvokeInstruction invoke) Looks for the method referenced by the given invoke instruction in the given class.private MethodgetMethodRecursive(JavaClass jc, InvokeInstruction invoke) Looks for the method referenced by the given invoke instruction in the given class or its super classes and super interfaces.private ObjectTypeprivate voidindexValid(Instruction i, int idx) A utility method to raise an exception if the index is not a valid constant pool index.private intUtility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance.voidvisitALOAD(ALOAD o) Checks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidvisitDLOAD(DLOAD o) Checks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidvisitFLOAD(FLOAD o) Checks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidvisitILOAD(ILOAD o) Checks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidvisitLLOAD(LLOAD o) Checks if the constraints of operands of the said instruction(s) are satisfied.voidvisitLoadClass(LoadClass loadClass) Assures the generic preconditions of a LoadClass instance.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.voidChecks if the constraints of operands of the said instruction(s) are satisfied.Methods inherited from class org.apache.bcel.generic.EmptyVisitor
visitAALOAD, visitAASTORE, visitACONST_NULL, visitAllocationInstruction, visitARETURN, visitArithmeticInstruction, visitArrayInstruction, visitARRAYLENGTH, visitATHROW, visitBALOAD, visitBASTORE, visitBIPUSH, visitBranchInstruction, visitBREAKPOINT, visitCALOAD, visitCASTORE, visitConstantPushInstruction, visitConversionInstruction, visitCPInstruction, visitD2F, visitD2I, visitD2L, visitDADD, visitDALOAD, visitDASTORE, visitDCMPG, visitDCMPL, visitDCONST, visitDDIV, visitDMUL, visitDNEG, visitDREM, visitDRETURN, visitDSUB, visitDUP, visitDUP_X1, visitDUP_X2, visitDUP2, visitDUP2_X1, visitDUP2_X2, visitExceptionThrower, visitF2D, visitF2I, visitF2L, visitFADD, visitFALOAD, visitFASTORE, visitFCMPG, visitFCMPL, visitFCONST, visitFDIV, visitFieldOrMethod, visitFMUL, visitFNEG, visitFREM, visitFRETURN, visitFSUB, visitGETFIELD, visitGOTO, visitGOTO_W, visitGotoInstruction, visitI2B, visitI2C, visitI2D, visitI2F, visitI2L, visitI2S, visitIADD, visitIALOAD, visitIAND, visitIASTORE, visitICONST, visitIDIV, visitIF_ACMPEQ, visitIF_ACMPNE, visitIF_ICMPEQ, visitIF_ICMPGE, visitIF_ICMPGT, visitIF_ICMPLE, visitIF_ICMPLT, visitIF_ICMPNE, visitIFEQ, visitIFGE, visitIFGT, visitIfInstruction, visitIFLE, visitIFLT, visitIFNE, visitIFNONNULL, visitIFNULL, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISUB, visitIUSHR, visitIXOR, visitJSR, visitJSR_W, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDIV, visitLMUL, visitLNEG, visitLoadInstruction, visitLocalVariableInstruction, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSUB, visitLUSHR, visitLXOR, visitMONITORENTER, visitMONITOREXIT, visitNOP, visitPOP, visitPOP2, visitPopInstruction, visitPushInstruction, visitPUTFIELD, visitRETURN, visitReturnInstruction, visitSALOAD, visitSASTORE, visitSelect, visitSIPUSH, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitSWAP, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction
-
Field Details
-
constantPoolGen
The ConstantPoolGen instance this Visitor operates on.
-
-
Constructor Details
-
InstOperandConstraintVisitor
InstOperandConstraintVisitor(ConstantPoolGen constantPoolGen) Constructs a new instance.
-
-
Method Details
-
constraintViolated
A utility method to always raise an exception. -
getMethod
Looks for the method referenced by the given invoke instruction in the given class.- Parameters:
jc- The class that defines the referenced method.invoke- The instruction that references the method.- Returns:
- The referenced method or null if not found.
-
getMethodRecursive
private Method getMethodRecursive(JavaClass jc, InvokeInstruction invoke) throws ClassNotFoundException Looks for the method referenced by the given invoke instruction in the given class or its super classes and super interfaces.- Parameters:
jc- The class that defines the referenced method.invoke- The instruction that references the method.- Returns:
- The referenced method or null if not found.
- Throws:
ClassNotFoundException
-
getObjectType
-
indexValid
A utility method to raise an exception if the index is not a valid constant pool index. -
maxLocals
private int maxLocals()Utility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance. -
visitALOAD
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitALOADin interfaceVisitor- Overrides:
visitALOADin classEmptyVisitor- Parameters:
o- The instruction.
-
visitANEWARRAY
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitANEWARRAYin interfaceVisitor- Overrides:
visitANEWARRAYin classEmptyVisitor- Parameters:
o- The instruction.
-
visitASTORE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitASTOREin interfaceVisitor- Overrides:
visitASTOREin classEmptyVisitor- Parameters:
o- The instruction.
-
visitCHECKCAST
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitCHECKCASTin interfaceVisitor- Overrides:
visitCHECKCASTin classEmptyVisitor- Parameters:
o- The instruction.
-
visitDLOAD
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitDLOADin interfaceVisitor- Overrides:
visitDLOADin classEmptyVisitor- Parameters:
o- The instruction.
-
visitDSTORE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitDSTOREin interfaceVisitor- Overrides:
visitDSTOREin classEmptyVisitor- Parameters:
o- The instruction.
-
visitFieldInstruction
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitFieldInstructionin interfaceVisitor- Overrides:
visitFieldInstructionin classEmptyVisitor- Parameters:
o- The instruction.
-
visitFLOAD
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitFLOADin interfaceVisitor- Overrides:
visitFLOADin classEmptyVisitor- Parameters:
o- The instruction.
-
visitFSTORE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitFSTOREin interfaceVisitor- Overrides:
visitFSTOREin classEmptyVisitor- Parameters:
o- The instruction.
-
visitGETSTATIC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitGETSTATICin interfaceVisitor- Overrides:
visitGETSTATICin classEmptyVisitor- Parameters:
o- The instruction.
-
visitIINC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitIINCin interfaceVisitor- Overrides:
visitIINCin classEmptyVisitor- Parameters:
o- The instruction.
-
visitILOAD
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitILOADin interfaceVisitor- Overrides:
visitILOADin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINSTANCEOF
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINSTANCEOFin interfaceVisitor- Overrides:
visitINSTANCEOFin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINVOKEDYNAMIC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINVOKEDYNAMICin interfaceVisitor- Overrides:
visitINVOKEDYNAMICin classEmptyVisitor- Parameters:
o- The instruction.
-
visitInvokeInstruction
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitInvokeInstructionin interfaceVisitor- Overrides:
visitInvokeInstructionin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINVOKEINTERFACE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINVOKEINTERFACEin interfaceVisitor- Overrides:
visitINVOKEINTERFACEin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINVOKESPECIAL
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINVOKESPECIALin interfaceVisitor- Overrides:
visitINVOKESPECIALin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINVOKESTATIC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINVOKESTATICin interfaceVisitor- Overrides:
visitINVOKESTATICin classEmptyVisitor- Parameters:
o- The instruction.
-
visitINVOKEVIRTUAL
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitINVOKEVIRTUALin interfaceVisitor- Overrides:
visitINVOKEVIRTUALin classEmptyVisitor- Parameters:
o- The instruction.
-
visitISTORE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitISTOREin interfaceVisitor- Overrides:
visitISTOREin classEmptyVisitor- Parameters:
o- The instruction.
-
visitLDC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitLDCin interfaceVisitor- Overrides:
visitLDCin classEmptyVisitor- Parameters:
ldc- The instruction.
-
visitLDC2_W
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitLDC2_Win interfaceVisitor- Overrides:
visitLDC2_Win classEmptyVisitor- Parameters:
o- The instruction.
-
visitLLOAD
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitLLOADin interfaceVisitor- Overrides:
visitLLOADin classEmptyVisitor- Parameters:
o- The instruction.
-
visitLoadClass
Assures the generic preconditions of a LoadClass instance. The referenced class is loaded and pass2-verified.- Specified by:
visitLoadClassin interfaceVisitor- Overrides:
visitLoadClassin classEmptyVisitor- Parameters:
loadClass- The load class.
-
visitLOOKUPSWITCH
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitLOOKUPSWITCHin interfaceVisitor- Overrides:
visitLOOKUPSWITCHin classEmptyVisitor- Parameters:
o- The instruction.
-
visitLSTORE
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitLSTOREin interfaceVisitor- Overrides:
visitLSTOREin classEmptyVisitor- Parameters:
o- The instruction.
-
visitMULTIANEWARRAY
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitMULTIANEWARRAYin interfaceVisitor- Overrides:
visitMULTIANEWARRAYin classEmptyVisitor- Parameters:
o- The instruction.
-
visitNEW
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitNEWin interfaceVisitor- Overrides:
visitNEWin classEmptyVisitor- Parameters:
o- The instruction.
-
visitNEWARRAY
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitNEWARRAYin interfaceVisitor- Overrides:
visitNEWARRAYin classEmptyVisitor- Parameters:
o- The instruction.
-
visitPUTSTATIC
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitPUTSTATICin interfaceVisitor- Overrides:
visitPUTSTATICin classEmptyVisitor- Parameters:
o- The instruction.
-
visitRET
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitRETin interfaceVisitor- Overrides:
visitRETin classEmptyVisitor- Parameters:
o- The instruction.
-
visitTABLESWITCH
Checks if the constraints of operands of the said instruction(s) are satisfied.- Specified by:
visitTABLESWITCHin interfaceVisitor- Overrides:
visitTABLESWITCHin classEmptyVisitor- Parameters:
o- The instruction.
-