[patch] bad iinc behavior with large local variable index

Andrew Huntwork <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
IINC isn't wide unless the index is > MAX_SHORT or increment is > 
Byte.MAX_BYTE.  but the jvm spec says that for non-wide iinc, index is 
an unsigned byte.  the attached patch fixes my problem.

-- 
"I say to you that the VCR is to the American film
producer and the American public as the Boston
strangler is to the woman home alone."
         -Jack Valenti, President, Motion Picture
          Association of America, Inc., before
          The House Subcommittee on Courts, Civil
          Liberties, and The Administration of
          Justice, August, 1982,
          http://cryptome.org/hrcw-hear.htm

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
diff (text/plain, 382 B)
--- IINC.java.old	2003-11-24 15:01:20.000000000 -0700
+++ IINC.java	2003-11-24 15:03:12.000000000 -0700
@@ -106,7 +106,7 @@
   }
 
   private final void setWide() {
-    if(wide = ((n > org.apache.bcel.Constants.MAX_SHORT) ||
+    if(wide = ((n > org.apache.bcel.Constants.MAX_BYTE) ||
 	       (Math.abs(c) > Byte.MAX_VALUE)))
       length = 6; // wide byte included  
     else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.