From: Russ Cox Date: Mon, 24 Sep 2012 03:04:28 +0000 (-0400) Subject: time: prepare for 64-bit ints X-Git-Tag: go1.1rc2~2363 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=edce6349639e321c3b1a34036a8fbc08ad363cd3;p=gostls13.git time: prepare for 64-bit ints The code was trying to interpret a uint32 n as a signed quantity and then store it in an int. For this, int(n) currently works, but when int becomes 64 bits one must write int(int32(n)) instead, to get the 32-bit sign extension. Update #2188. R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/6551068 --- diff --git a/src/pkg/time/zoneinfo_read.go b/src/pkg/time/zoneinfo_read.go index ebb4205a98..d57c09e115 100644 --- a/src/pkg/time/zoneinfo_read.go +++ b/src/pkg/time/zoneinfo_read.go @@ -141,7 +141,7 @@ func loadZoneData(bytes []byte) (l *Location, err error) { if n, ok = zonedata.big4(); !ok { return nil, badData } - zone[i].offset = int(n) + zone[i].offset = int(int32(n)) var b byte if b, ok = zonedata.byte(); !ok { return nil, badData