]> source.dussan.org Git - aspectj.git/commitdiff
Fix for
authorehilsdal <ehilsdal>
Tue, 11 Mar 2003 06:06:56 +0000 (06:06 +0000)
committerehilsdal <ehilsdal>
Tue, 11 Mar 2003 06:06:56 +0000 (06:06 +0000)
Bugzilla Bug 32239
Dumps assembly code if Object[] used in args (BcelRenderer.java:152)
Not surprisingly, this bug was fixed by lubbing an occurrence of ObjectType
to ReferenceType, and then dispatching back for array types and/or class
types going to BCEL.

weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java
weaver/src/org/aspectj/weaver/bcel/Utility.java

index ea391c7e3c9d351b233ecbb45936a77d41b7a151..6642b1fc873c85292733185689ec46b1648ad7b4 100644 (file)
@@ -17,7 +17,7 @@ import org.apache.bcel.Constants;
 import org.apache.bcel.generic.InstructionFactory;
 import org.apache.bcel.generic.InstructionHandle;
 import org.apache.bcel.generic.InstructionList;
-import org.apache.bcel.generic.ObjectType;
+import org.apache.bcel.generic.ReferenceType;
 import org.apache.bcel.generic.Type;
 import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.Member;
@@ -167,7 +167,7 @@ public class BcelRenderer implements ITestVisitor, IExprVisitor {
     public void visit(Instanceof i) {
         instructions.insert(createJumpBasedOnBooleanOnStack());
         instructions.insert(
-            Utility.createInstanceof(fact, (ObjectType) world.makeBcelType(i.getType())));
+            Utility.createInstanceof(fact, (ReferenceType) world.makeBcelType(i.getType())));
         i.getVar().accept(this);
     }
 
index 1fc1895981153a490d323f5e9adeec040528f118..4d54a786e2f6a1413708445cc8242acc2c552b05 100644 (file)
@@ -33,6 +33,7 @@ import org.apache.bcel.generic.InstructionList;
 import org.apache.bcel.generic.InstructionTargeter;
 import org.apache.bcel.generic.LDC;
 import org.apache.bcel.generic.ObjectType;
+import org.apache.bcel.generic.ArrayType;
 import org.apache.bcel.generic.ReferenceType;
 import org.apache.bcel.generic.SIPUSH;
 import org.apache.bcel.generic.TargetLostException;
@@ -149,11 +150,14 @@ public class Utility {
             kind);
        }
 
-    public static Instruction createInstanceof(InstructionFactory fact, ObjectType t) {
-        return new INSTANCEOF(fact.getConstantPool().addClass(t));        
+    public static Instruction createInstanceof(InstructionFactory fact, ReferenceType t) {
+               int cpoolEntry =
+                       (t instanceof ArrayType)
+                       ? fact.getConstantPool().addArrayClass((ArrayType)t)
+                       : fact.getConstantPool().addClass((ObjectType)t);
+               return new INSTANCEOF(cpoolEntry);
     }
 
-
     public static Instruction createInvoke(
             InstructionFactory fact,
             LazyMethodGen m) {