diff options
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java | 4 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/Utility.java | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java index ea391c7e3..6642b1fc8 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java @@ -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); } diff --git a/weaver/src/org/aspectj/weaver/bcel/Utility.java b/weaver/src/org/aspectj/weaver/bcel/Utility.java index 1fc189598..4d54a786e 100644 --- a/weaver/src/org/aspectj/weaver/bcel/Utility.java +++ b/weaver/src/org/aspectj/weaver/bcel/Utility.java @@ -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) { |