OSDN Git Service

2001-01-16 Hans Boehm <hans_boehm@hp.com>
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Jan 2001 01:00:53 +0000 (01:00 +0000)
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Jan 2001 01:00:53 +0000 (01:00 +0000)
* java/math/BigInteger.java (setShiftRight): Only do negative shift
if count != 0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39080 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 3ed758f..5b13ec0 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-16  Hans Boehm  <hans_boehm@hp.com>
+
+       * java/math/BigInteger.java (setShiftRight): Only do negative shift
+       if count != 0.
+
 2001-01-14  Mark Wielaard  <mark@klomp.org>
        * java/net/URLDecoder.java: Thanks Edgar Villanueva (edgarvil@home.com)
        (decode): Merge comments with Classpath, don't throw Exception
index ed1f4f0..d3fcb02 100644 (file)
@@ -1401,11 +1401,13 @@ public class BigInteger extends Number implements Comparable
              realloc(d_len);
            if (count == 0)
              System.arraycopy(x.words, word_count, words, 0, d_len);
-           else
-             MPN.rshift(words, x.words, word_count, d_len, count);
+            else
+             {
+               MPN.rshift(words, x.words, word_count, d_len, count);
+               if (neg)
+                 words[d_len-1] |= -1 << (32 - count);
+              }
            ival = d_len;
-           if (neg)
-             words[ival-1] |= -1 << (32 - count);
          }
       }
   }