OSDN Git Service

2011-09-24 John Salmon <john.salmon@deshaw.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Sep 2011 18:28:48 +0000 (18:28 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Sep 2011 18:28:48 +0000 (18:28 +0000)
PR libstdc++/50509
* include/bits/random.tcc (seed_seq::generate): Fix computation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@179145 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.tcc

index ebd36d2..4c89d74 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-24  John Salmon  <john.salmon@deshaw.com>
+
+       PR libstdc++/50509
+       * include/bits/random.tcc (seed_seq::generate): Fix computation.
+
 2011-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
index e81392f..8ea8891 100644 (file)
@@ -2768,7 +2768,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          _Type __arg = (__begin[__k % __n]
                         ^ __begin[(__k + __p) % __n]
                         ^ __begin[(__k - 1) % __n]);
-         _Type __r1 = __arg ^ (__arg << 27);
+         _Type __r1 = __arg ^ (__arg >> 27);
          __r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
                                 1664525u, 0u>(__r1);
          _Type __r2 = __r1;
@@ -2790,7 +2790,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          _Type __arg = (__begin[__k % __n]
                         + __begin[(__k + __p) % __n]
                         + __begin[(__k - 1) % __n]);
-         _Type __r3 = __arg ^ (__arg << 27);
+         _Type __r3 = __arg ^ (__arg >> 27);
          __r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
                                 1566083941u, 0u>(__r3);
          _Type __r4 = __r3 - __k % __n;