diff options
author | ehilsdal <ehilsdal> | 2003-03-11 06:06:56 +0000 |
---|---|---|
committer | ehilsdal <ehilsdal> | 2003-03-11 06:06:56 +0000 |
commit | ae0ef30e2a9c8a4ef7ff59219b15b5109c956d22 (patch) | |
tree | 3cdb644666c79423c4f8a86cd39442e7370e0b22 /weaver | |
parent | 661473e03c230144e3fda076d1b5775a27a670d7 (diff) | |
download | aspectj-ae0ef30e2a9c8a4ef7ff59219b15b5109c956d22.tar.gz aspectj-ae0ef30e2a9c8a4ef7ff59219b15b5109c956d22.zip |
Fix for
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.
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) { |