aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/CodeIterator.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2009-03-18 12:49:41 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2009-03-18 12:49:41 +0000
commit956c82413bde3e58b9401e63543451939ec983f3 (patch)
tree07e299cf06813c962960bf5b99bd2d40296e29c4 /src/main/javassist/bytecode/CodeIterator.java
parent43217031ebc53b96aeb11ac1fc4bb7d5d86bf9cf (diff)
downloadjavassist-956c82413bde3e58b9401e63543451939ec983f3.tar.gz
javassist-956c82413bde3e58b9401e63543451939ec983f3.zip
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
Diffstat (limited to 'src/main/javassist/bytecode/CodeIterator.java')
-rw-r--r--src/main/javassist/bytecode/CodeIterator.java27
1 files 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);