From: chiba Date: Tue, 9 Jun 2009 11:00:05 +0000 (+0000) Subject: fixed JIRA JASSIST-67 X-Git-Tag: rel_3_17_1_ga~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6b1e9c76584cd05513882b43438a80e2da42130b;p=javassist.git fixed JIRA JASSIST-67 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@481 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/Readme.html b/Readme.html index fd5ada2e..009fa5ed 100644 --- a/Readme.html +++ b/Readme.html @@ -283,7 +283,7 @@ see javassist.Dump.

-version 3.11

-version 3.10 on March 5, 2009 diff --git a/src/main/javassist/compiler/CodeGen.java b/src/main/javassist/compiler/CodeGen.java index 85b8799c..470a9766 100644 --- a/src/main/javassist/compiler/CodeGen.java +++ b/src/main/javassist/compiler/CodeGen.java @@ -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);