public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com
Subject: libgo patch committed: Fix json test when rand returns 0
Date: Wed, 06 Jul 2011 18:39:00 -0000	[thread overview]
Message-ID: <mcrr5636yql.fsf@coign.corp.google.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

This patch is necessary when compiling the test cases with optimization,
which changes the order of the calls to rand.  I proposed the same patch
to the upstream library.  Bootstrapped and tested on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 365 bytes --]

diff -r 48658f7ed377 libgo/go/json/scanner_test.go
--- a/libgo/go/json/scanner_test.go	Fri Jun 24 07:06:48 2011 -0700
+++ b/libgo/go/json/scanner_test.go	Wed Jul 06 11:35:51 2011 -0700
@@ -252,6 +252,9 @@
 	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)

                 reply	other threads:[~2011-07-06 18:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcrr5636yql.fsf@coign.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).