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
This commit is contained in:
parent
60b4539438
commit
d75dae75d7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user