From 43217031ebc53b96aeb11ac1fc4bb7d5d86bf9cf Mon Sep 17 00:00:00 2001 From: chiba Date: Wed, 18 Mar 2009 12:20:53 +0000 Subject: [PATCH] JASSIST-74 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@469 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/CodeIterator.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/javassist/bytecode/CodeIterator.java b/src/main/javassist/bytecode/CodeIterator.java index cd0bb352..d93e46b8 100644 --- a/src/main/javassist/bytecode/CodeIterator.java +++ b/src/main/javassist/bytecode/CodeIterator.java @@ -376,7 +376,7 @@ public class CodeIterator implements Opcode { * Inserts a gap * before the next instruction that would be returned by * next() (not before the instruction returned - * by tha last call to next()). + * by the last call to next()). * Branch offsets and the exception table are also updated. * The inserted gap is filled with NOP. The gap length may be * extended to a multiple of 4. @@ -718,8 +718,12 @@ public class CodeIterator implements Opcode { int i0 = i; int i2 = (i & ~3) + 4; // 0-3 byte padding - while (i0 < i2) - newcode[j++] = code[i0++]; + while (i0 < i2) { + // IBM JVM 1.4.2 cannot run the following line: + // newcode[j++] = code[i0++]; + // see JIRA JASSIST-74. + newcode[j++] = 0; i0++; + } int defaultbyte = newOffset(i, ByteArray.read32bit(code, i2), where, gapLength, exclusive); @@ -745,8 +749,12 @@ public class CodeIterator implements Opcode { int i0 = i; int i2 = (i & ~3) + 4; // 0-3 byte padding - while (i0 < i2) - newcode[j++] = code[i0++]; + while (i0 < i2) { + // IBM JVM 1.4.2 cannot run the following line: + // newcode[j++] = code[i0++]; + // see JIRA JASSIST-74. + newcode[j++] = 0; i0++; + } int defaultbyte = newOffset(i, ByteArray.read32bit(code, i2), where, gapLength, exclusive); -- 2.39.5