Browse Source

Fix bug report 34320, about random returning two same values at start

git-svn-id: trunk@35259 -
pierre 8 years ago
parent
commit
d5f2c58d32
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rtl/inc/system.inc

+ 2 - 1
rtl/inc/system.inc

@@ -643,10 +643,11 @@ begin
       OldRandSeed:=RandSeed;
       l_index:=MTWIST_N;
     end;
-  if mt_index=MTWIST_N then
+  if l_index=MTWIST_N then
     begin
       mtwist_update_state;
       l_index:=0;
+      mt_index:=1;
     end;
   result:=mt_state[l_index];
   result:=result xor (result shr 11);