summaryrefslogtreecommitdiff
path: root/libgo/go/fmt
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 15:01:11 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 15:01:11 +0000
commitc92b1bc7f829182c2a5276ebd4567f54f6cc713d (patch)
treedf1037674f2c69011469485414315a50607f9d08 /libgo/go/fmt
parentc4ded1f63a3daf6467bd2caa4a1f4807f4983830 (diff)
downloadgcc-c92b1bc7f829182c2a5276ebd4567f54f6cc713d.tar.gz
libgo: Update to Go 1.0.1 release.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187163 138bc75d-0d04-0410-961f-82ee72b054a4
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 e0c587a3525..500a45944d8 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 2186f334b91..caf900d5c30 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"