Commit 7b0bb480 authored by Ian Lance Taylor's avatar Ian Lance Taylor

json: fix test if rand returns 0.

Fixes test when run with gccgo using optimization, which
changes the order of the calls to rand.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4639101
parent 6732bd35
......@@ -252,7 +252,10 @@ func genArray(n int) []interface{} {
if f > n {
f = n
}
x := make([]interface{}, int(f))
if n > 0 && f == 0 {
f = 1
}
x := make([]interface{}, f)
for i := range x {
x[i] = genValue(((i+1)*n)/f - (i*n)/f)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment