diff mbox

[v3] libstdc++/50509

Message ID 4E7E2193.9000005@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Sept. 24, 2011, 6:29 p.m. UTC
Hi,

committed mainline and 4_6-branch.

Paolo.

//////////////////////
2011-09-24  John Salmon  <john.salmon@deshaw.com>

	PR libstdc++/50509
	* include/bits/random.tcc (seed_seq::generate): Fix computation.
diff mbox

Patch

Index: include/bits/random.tcc
===================================================================
--- include/bits/random.tcc	(revision 179143)
+++ include/bits/random.tcc	(working copy)
@@ -2768,7 +2768,7 @@ 
 	  _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 @@ 
 	  _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;