Sfoglia il codice sorgente

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

git-svn-id: trunk@35259 -
pierre 8 anni fa
parent
commit
d5f2c58d32
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  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);