]> source.dussan.org Git - javassist.git/commitdiff
fixed JIRA JASSIST-67
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 Jun 2009 11:00:05 +0000 (11:00 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 Jun 2009 11:00:05 +0000 (11:00 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@481 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

Readme.html
src/main/javassist/compiler/CodeGen.java

index fd5ada2ed84d1e948257f8a4866a3246dfeb790d..009fa5ed34998153c58d8fef49a286d3fa506d3d 100644 (file)
@@ -283,7 +283,7 @@ see javassist.Dump.
 
 <p>-version 3.11
 <ul>
-       <li>JIRA JASSIST-68, 74, 75, 76, 67, 83 were fixed.
+       <li>JIRA JASSIST-67, 68, 74, 75, 76, 83 were fixed.
 </ul>
 
 <p>-version 3.10 on March 5, 2009
index 85b8799c43b6ff9afd9dddb8e74843b0790f81fd..470a976678574bfcd5059a089452ce18d45e262f 100644 (file)
@@ -1737,9 +1737,18 @@ public abstract class CodeGen extends Visitor implements Opcode, TokenId {
                 if (doDup && isPost)
                     bytecode.addIload(var);
 
-                bytecode.addOpcode(IINC);
-                bytecode.add(var);
-                bytecode.add(token == PLUSPLUS ? 1 : -1);
+                int delta = token == PLUSPLUS ? 1 : -1;
+                if (var > 0xff) {
+                    bytecode.addOpcode(WIDE);
+                    bytecode.addOpcode(IINC);
+                    bytecode.addIndex(var);
+                    bytecode.addIndex(delta);
+                }
+                else {
+                    bytecode.addOpcode(IINC);
+                    bytecode.add(var);
+                    bytecode.add(delta);
+                }
 
                 if (doDup && !isPost)
                     bytecode.addIload(var);