diff options
author | aclement <aclement> | 2008-12-04 23:41:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-12-04 23:41:16 +0000 |
commit | 7147c4a3650bc6ea608bce40363df2e79f5ddca5 (patch) | |
tree | 5f4e37e9802f775c7d3cb0f63ac6e2762c285cbc | |
parent | cec4c7798d9d35901d721d3e3cb8aca8db52aa78 (diff) | |
download | aspectj-7147c4a3650bc6ea608bce40363df2e79f5ddca5.tar.gz aspectj-7147c4a3650bc6ea608bce40363df2e79f5ddca5.zip |
162135: test and fix
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java index 5b8efc31b..b55d00545 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java @@ -192,7 +192,7 @@ public final class BcelRenderer implements ITestVisitor, IExprVisitor { public void visit(Literal literal) { if (literal == Literal.FALSE) - throw new BCException("bad"); + throw new BCException("visiting a false expression"); } public void visit(Call call) { @@ -204,7 +204,15 @@ public final class BcelRenderer implements ITestVisitor, IExprVisitor { for (int i = 0, len = args.length; i < len; i++) { // XXX only correct for static method calls Type desiredType = BcelWorld.makeBcelType(method.getParameterTypes()[i]); - callIl.append(renderExpr(fact, world, args[i], desiredType)); + Expr arg = args[i]; + // if arg is null it is because we couldn't bind it properly, for example see 162135 + if (arg == null) { + InstructionList iList = new InstructionList(); + iList.append(InstructionFactory.createNull(desiredType)); + callIl.append(iList); + } else { + callIl.append(renderExpr(fact, world, arg, desiredType)); + } } // System.out.println("rendered args: " + callIl); callIl.append(Utility.createInvoke(fact, world, method)); |