From: martynas Date: Thu, 18 Jun 2015 20:01:47 +0000 (+0000) Subject: Fix stack shuffle such that sj includes si and the last element actually X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5b49fdef5fba0304ba7ce13973408b376b62a5c8;p=openbsd Fix stack shuffle such that sj includes si and the last element actually gets a chance to be reordered. --- 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];