aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/fmt
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-05-04 15:01:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-05-04 15:01:11 +0000
commit33e337e34d69a2e298be8b6c109b601c2986339b (patch)
treedf1037674f2c69011469485414315a50607f9d08 /libgo/go/fmt
parent1eae36f08cddc7779cd0ed75b359c9a54f67adff (diff)
downloadgcc-33e337e34d69a2e298be8b6c109b601c2986339b.zip
gcc-33e337e34d69a2e298be8b6c109b601c2986339b.tar.gz
gcc-33e337e34d69a2e298be8b6c109b601c2986339b.tar.bz2
libgo: Update to Go 1.0.1 release.
From-SVN: r187163
Diffstat (limited to 'libgo/go/fmt')
-rw-r--r--libgo/go/fmt/fmt_test.go3
-rw-r--r--libgo/go/fmt/format.go2
2 files changed, 4 insertions, 1 deletions
diff --git a/libgo/go/fmt/fmt_test.go b/libgo/go/fmt/fmt_test.go
index e0c587a..500a459 100644
--- a/libgo/go/fmt/fmt_test.go
+++ b/libgo/go/fmt/fmt_test.go
@@ -461,6 +461,9 @@ var fmttests = []struct {
// zero reflect.Value, which formats as <nil>.
// This test is just to check that it shows the two NaNs at all.
{"%v", map[float64]int{math.NaN(): 1, math.NaN(): 2}, "map[NaN:<nil> NaN:<nil>]"},
+
+ // Used to crash because nByte didn't allow for a sign.
+ {"%b", int64(-1 << 63), "-1000000000000000000000000000000000000000000000000000000000000000"},
}
func TestSprintf(t *testing.T) {
diff --git a/libgo/go/fmt/format.go b/libgo/go/fmt/format.go
index 2186f33..caf900d 100644
--- a/libgo/go/fmt/format.go
+++ b/libgo/go/fmt/format.go
@@ -10,7 +10,7 @@ import (
)
const (
- nByte = 64
+ nByte = 65 // %b of an int64, plus a sign.
ldigits = "0123456789abcdef"
udigits = "0123456789ABCDEF"