diff options
Diffstat (limited to 'weaver/src')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index 5d3998858..e87b2d2c9 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -564,7 +564,13 @@ public final class LazyMethodGen implements Traceable { BodyPrinter(PrintStream out) { this.pool = enclosingClass.getConstantPool(); - this.body = getBody(); + this.body = getBodyForPrint(); + this.out = out; + } + + BodyPrinter(PrintStream out,InstructionList il) { + this.pool = enclosingClass.getConstantPool(); + this.body = il; this.out = out; } @@ -864,6 +870,9 @@ public final class LazyMethodGen implements Traceable { markAsChanged(); return body; } + public InstructionList getBodyForPrint() { + return body; + } public boolean hasBody() { if (savedMethod != null) return savedMethod.getCode() != null; @@ -1258,14 +1267,15 @@ public final class LazyMethodGen implements Traceable { if (branchInstruction instanceof InstructionSelect) { // Either LOOKUPSWITCH or TABLESWITCH - InstructionHandle[] targets = ((InstructionSelect)branchInstruction).getTargets(); + InstructionSelect iSelect = ((InstructionSelect)branchInstruction); + InstructionHandle[] targets = iSelect.getTargets(); for (int k = targets.length - 1; k >= 0; k--) { InstructionHandle oneTarget = targets[k]; if (handlesForDeletion.contains(oneTarget)) { do { oneTarget = oneTarget.getNext(); } while (handlesForDeletion.contains(oneTarget)); - branchInstruction.setTarget(oneTarget); + iSelect.setTarget(k,oneTarget); oneTarget.addTargeter(branchInstruction); } } |