From 5b49fdef5fba0304ba7ce13973408b376b62a5c8 Mon Sep 17 00:00:00 2001 From: martynas Date: Thu, 18 Jun 2015 20:01:47 +0000 Subject: [PATCH] Fix stack shuffle such that sj includes si and the last element actually gets a chance to be reordered. --- gnu/gcc/gcc/cfgexpand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/gcc/gcc/cfgexpand.c b/gnu/gcc/gcc/cfgexpand.c index d69855dbeb6..17aff165f6d 100644 --- a/gnu/gcc/gcc/cfgexpand.c +++ b/gnu/gcc/gcc/cfgexpand.c @@ -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]; -- 2.20.1