projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60b4539
)
json: fix test when rand returns 0.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 6 Jul 2011 18:38:24 +0000
(18:38 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 6 Jul 2011 18:38:24 +0000
(18:38 +0000)
Fixes using gccgo when optimizing, which changes the order of
calls to rand. Same patch proposed upstream.
From-SVN: r175927
libgo/go/json/scanner_test.go
patch
|
blob
|
history
diff --git
a/libgo/go/json/scanner_test.go
b/libgo/go/json/scanner_test.go
index 0d4de3246dd0fa4000df0b67acff73c4c42db420..df87c716aff2269d34883488ee1813be0a03f734 100644
(file)
--- a/
libgo/go/json/scanner_test.go
+++ b/
libgo/go/json/scanner_test.go
@@
-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)