]> source.dussan.org Git - javassist.git/commitdiff
the previous revision was wrong. this is a right fix for JASSIST-74
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 18 Mar 2009 12:49:41 +0000 (12:49 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 18 Mar 2009 12:49:41 +0000 (12:49 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@470 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/bytecode/CodeIterator.java

index d93e46b841ea28c59f9554a31fd970194f2a68bf..51d77ea3a4edf4d7c781d94cc4dd21ad4671a68b 100644 (file)
@@ -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);