diff options
author | aclement <aclement> | 2010-09-15 18:18:01 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-09-15 18:18:01 +0000 |
commit | 1263e05644a62c6f12178575dd8abb81a2cb94db (patch) | |
tree | cf7a2c558b50c790aabdacf4c13859a553f6c9bb /bcel-builder/src/org | |
parent | 923190c40b9f5a794167ceff5cf3f0c5b21c2d7b (diff) | |
download | aspectj-1263e05644a62c6f12178575dd8abb81a2cb94db.tar.gz aspectj-1263e05644a62c6f12178575dd8abb81a2cb94db.zip |
324932
Diffstat (limited to 'bcel-builder/src/org')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java index c5e2ab66f..6d8148f92 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java @@ -76,8 +76,9 @@ import org.aspectj.apache.bcel.util.ByteSequence; * * A list is finally dumped to a byte code array with <a href="#getByteCode()">getByteCode</a>. * - * @version $Id: InstructionList.java,v 1.10 2009/10/05 17:35:36 aclement Exp $ + * @version $Id: InstructionList.java,v 1.11 2010/09/15 18:18:01 aclement Exp $ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> + * @author Abraham Nevado * @see Instruction * @see InstructionHandle * @see BranchHandle @@ -886,20 +887,24 @@ public class InstructionList implements Serializable { // OPTIMIZE positions will only move around if there have been expanding instructions // if (max_additional_bytes==0...) { - // + // // } /* * Pass 2: Expand the variable-length (Branch)Instructions depending on the target offset (short or int) and ensure that * branch targets are within this list. */ + boolean nonZeroOffset = false; int offset = 0; for (InstructionHandle ih = start; ih != null; ih = ih.next) { if (ih instanceof BranchHandle) { offset += ((BranchHandle) ih).updatePosition(offset, maxAdditionalBytes); + if (offset != 0) { + nonZeroOffset = true; + } } } - if (offset != 0) { + if (nonZeroOffset) { /* * Pass 3: Update position numbers (which may have changed due to the preceding expansions), like pass 1. */ |