Commit d75dae75 by Ian Lance Taylor

json: fix test when rand returns 0.

Fixes using gccgo when optimizing, which changes the order of
calls to rand.  Same patch proposed upstream.

From-SVN: r175927
parent 60b45394
......@@ -252,6 +252,9 @@ func genArray(n int) []interface{} {
if f > n {
f = n
}
if n > 0 && f == 0 {
f = 1
}
x := make([]interface{}, int(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