From 6b1e9c76584cd05513882b43438a80e2da42130b Mon Sep 17 00:00:00 2001 From: chiba Date: Tue, 9 Jun 2009 11:00:05 +0000 Subject: [PATCH] fixed JIRA JASSIST-67 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@481 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- Readme.html | 2 +- src/main/javassist/compiler/CodeGen.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) 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); -- 2.39.5