BigInteger.java (byteArrayToIntArray): Don't include extraneous/malformed sign word.
authorMark J. Roberts <mjr@statesmean.com>
Tue, 19 Jun 2001 11:42:03 +0000 (11:42 +0000)
committerWarren Levy <warrenl@gcc.gnu.org>
Tue, 19 Jun 2001 11:42:03 +0000 (11:42 +0000)
2001-06-19  Mark J. Roberts  <mjr@statesmean.com>

* java/math/BigInteger.java (byteArrayToIntArray): Don't include
extraneous/malformed sign word.

From-SVN: r43455

libjava/ChangeLog
libjava/java/math/BigInteger.java

index bb1463c4b86f930771df57878d5e489a21e71a30..6278cb6866ffd53e04ea26191066e731975ac196 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-19  Mark J. Roberts  <mjr@statesmean.com>
+
+       * java/math/BigInteger.java (byteArrayToIntArray): Don't include
+       extraneous/malformed sign word.
+
 2001-06-15  Tom Tromey  <tromey@redhat.com>
 
        * jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
index 1d848d13e8fac163da99bcd20e02aa426bed2222..3a99de993aa787aecce8041da10bc4d9135d6768 100644 (file)
@@ -220,13 +220,9 @@ public class BigInteger extends Number implements Comparable
   private static int[] byteArrayToIntArray(byte[] bytes, int sign)
   {
     // Determine number of words needed.
-    int[] words = new int[(bytes.length + 3) / 4 + 1];
+    int[] words = new int[bytes.length/4 + 1];
     int nwords = words.length;
 
-    // For simplicity, tack on an extra word of sign at the front,
-    // it will be canonicalized out later. */
-    words[--nwords] = sign;
-
     // Create a int out of modulo 4 high order bytes.
     int bptr = 0;
     int word = sign;