You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by en...@apache.org on 2002/07/05 00:16:43 UTC
cvs commit: jakarta-bcel/src/java/org/apache/bcel/verifier/structurals InstConstraintVisitor.java
enver 2002/07/04 15:16:42
Modified: src/java/org/apache/bcel/verifier/structurals
InstConstraintVisitor.java
Log:
Fixed two minor bugs.
Commented out assigns to unused variables.
Removed unnecessary import statements.
Revision Changes Path
1.4 +12 -18 jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
Index: InstConstraintVisitor.java
===================================================================
RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InstConstraintVisitor.java 9 Mar 2002 22:30:15 -0000 1.3
+++ InstConstraintVisitor.java 4 Jul 2002 22:16:42 -0000 1.4
@@ -62,19 +62,14 @@
import org.apache.bcel.classfile.ConstantInteger;
import org.apache.bcel.classfile.ConstantFieldref;
import org.apache.bcel.classfile.ConstantFloat;
-import org.apache.bcel.classfile.ConstantInterfaceMethodref;
import org.apache.bcel.classfile.ConstantLong;
-import org.apache.bcel.classfile.ConstantNameAndType;
import org.apache.bcel.classfile.ConstantString;
-import org.apache.bcel.classfile.ConstantUtf8;
import org.apache.bcel.classfile.Field;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.generic.*;
import org.apache.bcel.verifier.*;
import org.apache.bcel.verifier.exc.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
+
/**
* A Visitor class testing for valid preconditions of JVM instructions.
@@ -330,7 +325,7 @@
// visitLoadClass(o) has been called before: Every FieldOrMethod
// implements LoadClass.
// visitCPInstruction(o) has been called before.
-//TODO
+ //TODO
}
/**
@@ -432,7 +427,7 @@
constraintViolated(o, "Reference type expected on top of stack, but is: '"+stack().peek()+"'.");
}
referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()));
- ReferenceType objectref = (ReferenceType) (stack().peek());
+ //ReferenceType objectref = (ReferenceType) (stack().peek());
// TODO: This can only be checked if using Staerk-et-al's "set of object types" instead of a
// "wider cast object type" created during verification.
//if (! (objectref.isAssignmentCompatibleWith(mg.getType())) ){
@@ -608,7 +603,7 @@
Type value = stack().peek(0);
indexOfInt(o, index);
- valueOfInt(o, index);
+ valueOfInt(o, value);
if (arrayrefOfArrayType(o, arrayref)){
if (! ( (((ArrayType) arrayref).getElementType().equals(Type.BOOLEAN)) ||
(((ArrayType) arrayref).getElementType().equals(Type.BYTE)) ) )
@@ -650,7 +645,7 @@
Type value = stack().peek(0);
indexOfInt(o, index);
- valueOfInt(o, index);
+ valueOfInt(o, value);
if (arrayrefOfArrayType(o, arrayref)){
if (! ((ArrayType) arrayref).getElementType().equals(Type.CHAR) ){
constraintViolated(o, "The 'arrayref' does not refer to an array with elements of type char but to an array of type "+((ArrayType) arrayref).getElementType()+".");
@@ -1639,7 +1634,8 @@
constraintViolated(o, "The 'count' argument must not be 0.");
}
// It is a ConstantInterfaceMethodref, Pass 3a made it sure.
- ConstantInterfaceMethodref cimr = (ConstantInterfaceMethodref) (cpg.getConstant(o.getIndex()));
+ // TODO: Do we want to do anything with it?
+ //ConstantInterfaceMethodref cimr = (ConstantInterfaceMethodref) (cpg.getConstant(o.getIndex()));
// the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).
@@ -1668,8 +1664,8 @@
}
if (! fromStack.equals(fromDesc)){
if (fromStack instanceof ReferenceType && fromDesc instanceof ReferenceType){
- ReferenceType rFromStack = (ReferenceType) fromStack;
- ReferenceType rFromDesc = (ReferenceType) fromDesc;
+ //ReferenceType rFromStack = (ReferenceType) fromStack;
+ //ReferenceType rFromDesc = (ReferenceType) fromDesc;
// TODO: This can only be checked when using Staerk-et-al's "set of object types"
// instead of a "wider cast object type" created during verification.
//if ( ! rFromStack.isAssignmentCompatibleWith(rFromDesc) ){
@@ -1699,10 +1695,8 @@
}
}
- String objref_classname = ((ObjectType) objref).getClassName();
-
- String theInterface = o.getClassName(cpg);
-
+ // String objref_classname = ((ObjectType) objref).getClassName();
+ // String theInterface = o.getClassName(cpg);
// TODO: This can only be checked if we're using Staerk-et-al's "set of object types"
// instead of "wider cast object types" generated during verification.
//if ( ! Repository.implementationOf(objref_classname, theInterface) ){
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>