Fix stack shuffle such that sj includes si and the last element actually
authormartynas <martynas@openbsd.org>
Thu, 18 Jun 2015 20:01:47 +0000 (20:01 +0000)
committermartynas <martynas@openbsd.org>
Thu, 18 Jun 2015 20:01:47 +0000 (20:01 +0000)
gets a chance to be reordered.

gnu/gcc/gcc/cfgexpand.c

index d69855d..17aff16 100644 (file)
@@ -438,7 +438,7 @@ partition_stack_vars (void)
       for (si = n - 1; si > 0; si--)
        {
          size_t tmp;
-         sj = arc4random_uniform(si);
+         sj = arc4random_uniform(si + 1);
 
          tmp = stack_vars_sorted[si];
          stack_vars_sorted[si] = stack_vars_sorted[sj];