From 956c82413bde3e58b9401e63543451939ec983f3 Mon Sep 17 00:00:00 2001 From: chiba Date: Wed, 18 Mar 2009 12:49:41 +0000 Subject: [PATCH] the previous revision was wrong. this is a right fix for JASSIST-74 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@470 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/CodeIterator.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/javassist/bytecode/CodeIterator.java b/src/main/javassist/bytecode/CodeIterator.java index d93e46b8..51d77ea3 100644 --- a/src/main/javassist/bytecode/CodeIterator.java +++ b/src/main/javassist/bytecode/CodeIterator.java @@ -718,12 +718,13 @@ public class CodeIterator implements Opcode { int i0 = i; int i2 = (i & ~3) + 4; // 0-3 byte padding - 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++; - } + // IBM JVM 1.4.2 cannot run the following code: + // while (i0 < i2) + // newcode[j++] = code[i0++]; + // see JIRA JASSIST-74. + newcode[j++] = (byte)TABLESWITCH; + while (++i0 < i2) + newcode[j++] = 0; int defaultbyte = newOffset(i, ByteArray.read32bit(code, i2), where, gapLength, exclusive); @@ -749,12 +750,14 @@ public class CodeIterator implements Opcode { int i0 = i; int i2 = (i & ~3) + 4; // 0-3 byte padding - 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++; - } + + // IBM JVM 1.4.2 cannot run the following code: + // while (i0 < i2) + // newcode[j++] = code[i0++]; + // see JIRA JASSIST-74. + newcode[j++] = (byte)LOOKUPSWITCH; + while (++i0 < i2) + newcode[j++] = 0; int defaultbyte = newOffset(i, ByteArray.read32bit(code, i2), where, gapLength, exclusive); -- 2.39.5