]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agocmd/go: -a does apply to the standard library
Ian Lance Taylor [Fri, 21 Aug 2015 04:20:25 +0000 (21:20 -0700)]
cmd/go: -a does apply to the standard library

This changed in https://golang.org/cl/10761.

Update #12203.

Change-Id: Ia37ebb7ecba689ad3cb2559213d675f21cf03a95
Reviewed-on: https://go-review.googlesource.com/13799
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: enable vendoring experiment by default
Russ Cox [Thu, 27 Aug 2015 16:16:09 +0000 (12:16 -0400)]
cmd/go: enable vendoring experiment by default

If we're going to do this for Go 1.6 we might as well do it now
and find out what breaks.

Change-Id: I8306b7829d8d13b564a1466c902ec6ba1a5a58c1
Reviewed-on: https://go-review.googlesource.com/13967
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: restore LookupPort for integer strings
Russ Cox [Tue, 25 Aug 2015 15:25:46 +0000 (11:25 -0400)]
net: restore LookupPort for integer strings

This worked in Go 1.4 but was lost in the "pure Go" lookup
routines substituted late in the Go 1.5 cycle.

Fixes #12263.

Change-Id: I77ec9d97cd8e67ace99d6ac965e5bc16c151ba83
Reviewed-on: https://go-review.googlesource.com/13915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agosyscall: don't call Setgroups if Credential.Groups is empty
Alexander Morozov [Thu, 27 Aug 2015 03:45:28 +0000 (20:45 -0700)]
syscall: don't call Setgroups if Credential.Groups is empty

Setgroups with zero-length groups is no-op for changing groups and
supposed to be used only for determining curent groups length. Also
because we deny setgroups by default if use GidMappings we have
unnecessary error from that no-op syscall.

Change-Id: I8f74fbca9190a3dcbbef1d886c518e01fa05eb62
Reviewed-on: https://go-review.googlesource.com/13938
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go: properly ignore import comments for vendored packages rooted at GOPATH
Vincent Vanackere [Wed, 26 Aug 2015 13:55:27 +0000 (15:55 +0200)]
cmd/go: properly ignore import comments for vendored packages rooted at GOPATH

Fixes #12232.

Change-Id: Ide3fb7f5fc5ae377ae8683fbb94fd0dc01480549
Reviewed-on: https://go-review.googlesource.com/13924
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agosrc/runtime: Add missing defs for android/386.
Tim Cooijmans [Thu, 20 Aug 2015 07:50:10 +0000 (09:50 +0200)]
src/runtime: Add missing defs for android/386.

Change-Id: I63bf6d2fdf41b49ff8783052d5d6c53b20e2f050
Reviewed-on: https://go-review.googlesource.com/13760
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
9 years agocmd/asm: fix potential infinite loop in parser
Didier Spezia [Tue, 25 Aug 2015 16:25:11 +0000 (16:25 +0000)]
cmd/asm: fix potential infinite loop in parser

For ARM machines, the assembler supports list of registers
operands such as [R1,R2].

A list missing a ']' results in the parser issuing many errors
and consuming all the tokens. At EOF (i.e. end of the line),
it still loops.

Normally, a counter is maintained to make sure the parser
stops after 10 errors. However, multiple errors occuring on the
same line are simply ignored. Only the first one is reported.
At most one error per line is accounted.

Missing ']' in a register list therefore results in an
infinite loop.

Fixed the parser by explicitly checking for ']' to interrupt
this loops

In the operand tests, also fixed a wrong entry which I think was
not set on purpose (but still led to a successful result).

Fixes #11764

Change-Id: Ie87773388ee0d21b3a2a4cb941d4d911d0230ba4
Reviewed-on: https://go-review.googlesource.com/13920
Reviewed-by: Rob Pike <r@golang.org>
9 years agotext/template: add ExecError type and return it from Execute on error
Rob Pike [Thu, 27 Aug 2015 06:28:52 +0000 (16:28 +1000)]
text/template: add ExecError type and return it from Execute on error

Useful to discriminate evaluation errors from write errors.

Fixes #11898.

Change-Id: I907d339a3820e887872d78e0e2d8fd011451fd19
Reviewed-on: https://go-review.googlesource.com/13957
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: remove unused xchgp/xchgp1
Michael Hudson-Doyle [Wed, 26 Aug 2015 22:59:43 +0000 (10:59 +1200)]
runtime: remove unused xchgp/xchgp1

I noticed that they were unimplemented on arm64 but then that they were
in fact not used at all.

Change-Id: Iee579feda2a5e374fa571bcc8c89e4ef607d50f6
Reviewed-on: https://go-review.googlesource.com/13951
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agogo/types: fix real(a) and imag(a) for untyped arguments
Robert Griesemer [Thu, 30 Jul 2015 23:06:36 +0000 (16:06 -0700)]
go/types: fix real(a) and imag(a) for untyped arguments

Fixes #11947.

Change-Id: I6225f96b8dea0cecb097f9c7452a1aa80ae4476d
Reviewed-on: https://go-review.googlesource.com/12939
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agonet/http/httputil: permit nil request body in ReverseProxy
Brad Fitzpatrick [Wed, 26 Aug 2015 17:53:59 +0000 (10:53 -0700)]
net/http/httputil: permit nil request body in ReverseProxy

Accepting a request with a nil body was never explicitly supported but
happened to work in the past.

This doesn't happen in most cases because usually people pass
a Server's incoming Request to the ReverseProxy's ServeHTTP method,
and incoming server requests are guaranteed to have non-nil bodies.

Still, it's a regression, so fix.

Fixes #12344

Change-Id: Id9a5a47aea3f2875d195b66c9a5f8581c4ca2aed
Reviewed-on: https://go-review.googlesource.com/13935
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agogo/types: check for duplicate values in expression switches
Robert Griesemer [Thu, 6 Aug 2015 20:55:19 +0000 (13:55 -0700)]
go/types: check for duplicate values in expression switches

Fixes #11578.

Change-Id: I29a542be247127f470ba6c39aac0d0f6a18de553
Reviewed-on: https://go-review.googlesource.com/13285
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agogo/types, go/constant: remove backward-compatibility files (cleanup)
Robert Griesemer [Mon, 24 Aug 2015 21:05:52 +0000 (14:05 -0700)]
go/types, go/constant: remove backward-compatibility files (cleanup)

Not needed anymore since go/types is always built against the current
standard library.

Fixes #11538.

Change-Id: I2f07d73703f4e5661c4b5df5d487939dcf530b43
Reviewed-on: https://go-review.googlesource.com/13897
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agonet/http: remove always true comparison
Todd Neal [Tue, 25 Aug 2015 23:44:30 +0000 (18:44 -0500)]
net/http: remove always true comparison

byte is unsigned so the comparison against zero is always true.

Change-Id: I8fa60245972be362ae920507a291f92c0f9831ad
Reviewed-on: https://go-review.googlesource.com/13941
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agotime: handle localized time zone names
Daniel Johansson [Sun, 23 Aug 2015 20:08:27 +0000 (22:08 +0200)]
time: handle localized time zone names

The existing implementation fails to determine the correct time zone
abbreviations when the display language is non-English. This change adds
support for localized time zone names (standard- and daylightname)
by using the function RegLoadMUIString.

Fixes #12015

Change-Id: Ic0dc89c50993af8f292b199c20bc5932903e7e87
Reviewed-on: https://go-review.googlesource.com/13854
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agobytes: improve Compare function on amd64 for large byte arrays
Uttam C Pawar [Thu, 2 Jul 2015 18:43:46 +0000 (11:43 -0700)]
bytes: improve Compare function on amd64 for large byte arrays

This patch contains only loop unrolling change for size > 63B

Following are the performance numbers for various sizes on
On Haswell based system: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz.

benchcmp go.head.8.25.15.txt go.head.8.25.15.opt.txt
benchmark                       old ns/op     new ns/op     delta
BenchmarkBytesCompare1-4        5.37          5.37          +0.00%
BenchmarkBytesCompare2-4        5.37          5.38          +0.19%
BenchmarkBytesCompare4-4        5.37          5.37          +0.00%
BenchmarkBytesCompare8-4        4.42          4.38          -0.90%
BenchmarkBytesCompare16-4       4.27          4.45          +4.22%
BenchmarkBytesCompare32-4       5.30          5.36          +1.13%
BenchmarkBytesCompare64-4       6.93          6.78          -2.16%
BenchmarkBytesCompare128-4      10.3          9.50          -7.77%
BenchmarkBytesCompare256-4      17.1          13.8          -19.30%
BenchmarkBytesCompare512-4      31.3          22.1          -29.39%
BenchmarkBytesCompare1024-4     62.5          39.0          -37.60%
BenchmarkBytesCompare2048-4     112           73.2          -34.64%

Change-Id: I4eeb1c22732fd62cbac97ba757b0d29f648d4ef1
Reviewed-on: https://go-review.googlesource.com/11871
Reviewed-by: Keith Randall <khr@golang.org>
9 years agomisc/cgo/testshared: do not run gccgo tests when gccgo is too old
Michael Hudson-Doyle [Sun, 23 Aug 2015 22:44:36 +0000 (10:44 +1200)]
misc/cgo/testshared: do not run gccgo tests when gccgo is too old

Fixes #12083

Change-Id: I8256739b33cf08d84dec23120d527667de2e6eea
Reviewed-on: https://go-review.googlesource.com/13822
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime: remove always false comparison in sigsend
Todd Neal [Tue, 25 Aug 2015 23:25:42 +0000 (18:25 -0500)]
runtime: remove always false comparison in sigsend

s is a uint32 and can never be zero. It's max value is already tested
against sig.wanted, whose size is derived from _NSIG.  This also
matches the test in signal_enable.

Fixes #11282

Change-Id: I8eec9c7df8eb8682433616462fe51b264c092475
Reviewed-on: https://go-review.googlesource.com/13940
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile, cmd/link, reflect, runtime: remove type.zero field
Michael Hudson-Doyle [Fri, 21 Aug 2015 03:23:57 +0000 (15:23 +1200)]
cmd/compile, cmd/link, reflect, runtime: remove type.zero field

No longer used after previous hashmap change.

Change-Id: I558470f872281e84a78406132df4e391d077b833
Reviewed-on: https://go-review.googlesource.com/13785
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/cgo: annotate named return struct members in comments
Andy Maloney [Mon, 3 Aug 2015 13:25:33 +0000 (09:25 -0400)]
cmd/cgo: annotate named return struct members in comments

If an exported function has named return variables, then show the names
as comments in the return struct we create in the header file.

Example here:

 https://groups.google.com/forum/#!topic/golang-nuts/r393ne4zIfY

Change-Id: I21fb4ca2673f6977bec35ccab0cef7d42b311f96
Reviewed-on: https://go-review.googlesource.com/13061
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile, runtime: stop returning t.zero on hashmap miss
Michael Hudson-Doyle [Fri, 21 Aug 2015 02:54:55 +0000 (14:54 +1200)]
cmd/compile, runtime: stop returning t.zero on hashmap miss

Previously t.zero always pointed to runtime.zerovalue. Change the hashmap code
to always return a runtime pointer directly, and change that pointer to point
to a larger buffer if one is needed.

(It might be better to only copy from the pointer returned by the mapaccess
functions when the value type is small enough and have the compiler insert
explicit zeroing for larger value types, but I tried and failed to do this).

This removes all uses of the zero field of the type data; the field itself can
be removed in a separate change.

Fixes #11491

Change-Id: I5b81752ff4067d74a5a281c41e88f151bae0171e
Reviewed-on: https://go-review.googlesource.com/13784
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/cgo: change comments in generated C code to be C-style
Andy Maloney [Thu, 6 Aug 2015 15:45:53 +0000 (11:45 -0400)]
cmd/cgo: change comments in generated C code to be C-style

Change-Id: I3889eda72ae0f57117f1d4299e3574f8bf68be67
Reviewed-on: https://go-review.googlesource.com/13310
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link: call moduledata symbols "local.moduledata" if they are created by the linker
Michael Hudson-Doyle [Wed, 19 Aug 2015 01:34:33 +0000 (13:34 +1200)]
cmd/link: call moduledata symbols "local.moduledata" if they are created by the linker

This was always a bit confusing, but it also fixes a problem: runtime.firstmoduledata
was always overridden in the linker to be a local symbol but cmd/internal/obj had
already rewritten code accessing it to access it via the GOT. This works on amd64, but
causes link failures on other platforms (e.g. arm64).

Change-Id: I9b8153af74b4d0f092211d63a000d15818f39773
Reviewed-on: https://go-review.googlesource.com/13786
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: fix register allocation for == operator
Ulrich Kunitz [Thu, 20 Aug 2015 16:56:18 +0000 (18:56 +0200)]
cmd/compile: fix register allocation for == operator

The issue 12226 has been caused by the allocation of the same register
for the equality check of two byte values. The code in cgen.go freed the
register for the second operand before the allocation of the register
for the first operand.

Fixes #12226

Change-Id: Ie4dc33a488bd48a17f8ae9b497fd63c1ae390555
Reviewed-on: https://go-review.googlesource.com/13771
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: fix uninitialized memory in compare of interface value
Austin Clements [Mon, 24 Aug 2015 17:35:49 +0000 (13:35 -0400)]
cmd/compile: fix uninitialized memory in compare of interface value

A comparison of the form l == r where l is an interface and r is
concrete performs a type assertion on l to convert it to r's type.
However, the compiler fails to zero the temporary where the result of
the type assertion is written, so if the type is a pointer type and a
stack scan occurs while in the type assertion, it may see an invalid
pointer on the stack.

Fix this by zeroing the temporary. This is equivalent to the fix for
type switches from c4092ac.

Fixes #12253.

Change-Id: Iaf205d456b856c056b317b4e888ce892f0c555b9
Reviewed-on: https://go-review.googlesource.com/13872
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: check pointer equality in arm64 cmpbody
Dave Cheney [Tue, 25 Aug 2015 03:12:32 +0000 (13:12 +1000)]
runtime: check pointer equality in arm64 cmpbody

Updates #11336

Follow the lead of amd64 by doing a pointer equality check
before comparing string/byte contents on arm64.

BenchmarkCompareBytesEqual-8               25.8           26.3           +1.94%
BenchmarkCompareBytesToNil-8               9.59           9.59           +0.00%
BenchmarkCompareBytesEmpty-8               9.59           9.17           -4.38%
BenchmarkCompareBytesIdentical-8           26.3           9.17           -65.13%
BenchmarkCompareBytesSameLength-8          16.3           16.3           +0.00%
BenchmarkCompareBytesDifferentLength-8     16.3           16.3           +0.00%
BenchmarkCompareBytesBigUnaligned-8        1132038        1131409        -0.06%
BenchmarkCompareBytesBig-8                 1126758        1128470        +0.15%
BenchmarkCompareBytesBigIdentical-8        1084366        9.17           -100.00%

Change-Id: Id7125c31957eff1ddb78897d4511bd50e79af3f7
Reviewed-on: https://go-review.googlesource.com/13885
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime: fix nmspinning comparison
Todd Neal [Tue, 25 Aug 2015 00:11:35 +0000 (19:11 -0500)]
runtime: fix nmspinning comparison

nmspinning has a value range of [0, 2^31-1].  Update the comment to
indicate this and fix the comparison so it's not always false.

Fixes #11280

Change-Id: Iedaf0654dcba5e2c800645f26b26a1a781ea1991
Reviewed-on: https://go-review.googlesource.com/13877
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: add a missing hex conversion
Shenghou Ma [Tue, 25 Aug 2015 01:24:23 +0000 (21:24 -0400)]
runtime: add a missing hex conversion

gobuf.g is a guintptr, so without hex(), it will be printed as
a decimal, which is not very helpful and inconsistent with how
other pointers are printed.

Change-Id: I7c0432e9709e90a5c3b3e22ce799551a6242d017
Reviewed-on: https://go-review.googlesource.com/13879
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: map/slice literals janitoring
Didier Spezia [Sun, 23 Aug 2015 13:59:00 +0000 (13:59 +0000)]
debug/elf: map/slice literals janitoring

Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Reformatted some expressions to improve readability.

Change-Id: Iaf123e6bd49162ec45c59297ad3b002ca59443bc
Reviewed-on: https://go-review.googlesource.com/13850
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go: skip test using external linking on linux/ppc64 too
Shenghou Ma [Tue, 25 Aug 2015 01:17:04 +0000 (21:17 -0400)]
cmd/go: skip test using external linking on linux/ppc64 too

While we're at it, also fix a typo.

Change-Id: Id436f33cffa5683e2a8450cce5b545960cf2877e
Reviewed-on: https://go-review.googlesource.com/13878
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoencoding/gob: remove always false comparison
Todd Neal [Mon, 24 Aug 2015 23:30:53 +0000 (18:30 -0500)]
encoding/gob: remove always false comparison

This is not a functional change. nr is a uint64 and can never be less
than zero, remove the no-op comparison.

Fixes #11279

Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369
Reviewed-on: https://go-review.googlesource.com/13876
Run-TryBot: Todd Neal <todd@tneal.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoos/signal: skip the nohup test on darwin when running in tmux.
Aaron Jacobs [Mon, 24 Aug 2015 22:53:42 +0000 (08:53 +1000)]
os/signal: skip the nohup test on darwin when running in tmux.

The nohup command doesn't work in tmux on darwin.

Fixes #5135.

Change-Id: I1c21073d8bd54b49dd6b0bad86ef088d6d8e7a5f
Reviewed-on: https://go-review.googlesource.com/13883
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agohash/fnv: fix wiki url
Joe Tsai [Thu, 6 Aug 2015 08:49:00 +0000 (01:49 -0700)]
hash/fnv: fix wiki url

The URL is shown on go docs and is an eye-sore.

For go1.6.

Change-Id: I8b8ea3751200d06ed36acfe22f47ebb38107f8db
Reviewed-on: https://go-review.googlesource.com/13282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: check pointer equality in arm cmpbody
Dave Cheney [Mon, 24 Aug 2015 05:07:58 +0000 (15:07 +1000)]
runtime: check pointer equality in arm cmpbody

Updates #11336

Follow the lead of amd64 do a pointer equality check
before comparing string/byte contents on arm.

BenchmarkCompareBytesEqual-4               208             211             +1.44%
BenchmarkCompareBytesToNil-4               83.6            81.8            -2.15%
BenchmarkCompareBytesEmpty-4               80.2            75.2            -6.23%
BenchmarkCompareBytesIdentical-4           208             75.2            -63.85%
BenchmarkCompareBytesSameLength-4          126             128             +1.59%
BenchmarkCompareBytesDifferentLength-4     128             130             +1.56%
BenchmarkCompareBytesBigUnaligned-4        14192804        14060971        -0.93%
BenchmarkCompareBytesBig-4                 12277313        12128193        -1.21%
BenchmarkCompareBytesBigIdentical-4        9385046         78.5            -100.00%

Change-Id: I5b24620018688c5fe04b6ff6743a24c4ce225788
Reviewed-on: https://go-review.googlesource.com/13881
Reviewed-by: Keith Randall <khr@golang.org>
9 years agofmt: in Scanf, %c can scan a space, so don't skip spaces at %c
Rob Pike [Sun, 23 Aug 2015 07:45:58 +0000 (17:45 +1000)]
fmt: in Scanf, %c can scan a space, so don't skip spaces at %c

In short, %c should just give you the next rune, period.
Apparently this is the design. I use the term loosely.

Fixes #12275

Change-Id: I6f30bed442c0e88eac2244d465c7d151b29cf393
Reviewed-on: https://go-review.googlesource.com/13821
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: remove mention of defunct golang-bugs mailing list
Andrew Gerrand [Mon, 24 Aug 2015 19:43:54 +0000 (05:43 +1000)]
doc: remove mention of defunct golang-bugs mailing list

Fixes #12299

Change-Id: Id7b73d2935c9f7c0952f833613973ef455d02b0d
Reviewed-on: https://go-review.googlesource.com/13858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoencoding/asn1: fix unused assignments
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:22 +0000 (19:51 -0700)]
encoding/asn1: fix unused assignments

Unused assignment for `err` encoding/asn1/marshal.go:622:3
Unused assignment for `err` encoding/asn1/marshal.go:650:5

Change-Id: I4226238645ce3640f25124cb405444e61439fd3f
Reviewed-on: https://go-review.googlesource.com/13847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: allow ParseMAC to parse 20-octet IPoIB link-layer address
Matt Layher [Fri, 17 Jul 2015 21:28:42 +0000 (17:28 -0400)]
net: allow ParseMAC to parse 20-octet IPoIB link-layer address

Fixes #11763

Change-Id: Ie291b36a8c29694e80940836d7e6fd96d2d76494
Reviewed-on: https://go-review.googlesource.com/12382
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoimage/gif: avoid unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:28 +0000 (19:51 -0700)]
image/gif: avoid unused assignment

Change-Id: Iaaecd8be9268c923f40cf0e5153cbf79f7015b8d
Reviewed-on: https://go-review.googlesource.com/13892
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agounicode: include rune 0 in RangeTables.
Marcel van Lohuizen [Wed, 19 Aug 2015 18:28:18 +0000 (20:28 +0200)]
unicode: include rune 0 in RangeTables.

All of Go passes. No changes for the text repo.

Fixes #10153

Change-Id: I313369bf471c8974390a6d42075e5c54f6a81750
Reviewed-on: https://go-review.googlesource.com/13667
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agogo/internal/gcimporter: remove unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:24 +0000 (19:51 -0700)]
go/internal/gcimporter: remove unused assignment

Change-Id: I0b19731a46e4e67a7dd503dd133cafc7678760a7
Reviewed-on: https://go-review.googlesource.com/13890
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agomath: avoid unused assignment in jn.go
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:33 +0000 (19:51 -0700)]
math: avoid unused assignment in jn.go

Change-Id: Ie4f21bcd5849e994c63ec5bbda2dee6f3ec4da12
Reviewed-on: https://go-review.googlesource.com/13891
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agointernal/syscall/windows/registry: remove debugging dreg
Alex Brainman [Mon, 24 Aug 2015 03:49:30 +0000 (13:49 +1000)]
internal/syscall/windows/registry: remove debugging dreg

Change-Id: I1b9f6ad322a7f68fa160c4f09d7fb56815e505a7
Reviewed-on: https://go-review.googlesource.com/13828
Reviewed-by: Rob Pike <r@golang.org>
9 years agomake.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT
Dave Cheney [Thu, 20 Aug 2015 02:28:51 +0000 (12:28 +1000)]
make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT

Fixes #12214

Change-Id: I82586b54ac7b9c0c71055bb66b921e3efbf4977c
Reviewed-on: https://go-review.googlesource.com/13719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/internal/obj: delete Debugzerostack dead code
Josh Bleecher Snyder [Sun, 23 Aug 2015 03:31:55 +0000 (20:31 -0700)]
cmd/internal/obj: delete Debugzerostack dead code

Fixes #11060

Change-Id: I4c6647fc2f103015b67e30dc2cdb6f771526c139
Reviewed-on: https://go-review.googlesource.com/13840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: drop redundant domain name length check
Mikio Hara [Sat, 22 Aug 2015 02:03:11 +0000 (11:03 +0900)]
net: drop redundant domain name length check

It is already validated by isDoaminName.

Change-Id: I7a955b632a5143e16b012641cf12bad452900753
Reviewed-on: https://go-review.googlesource.com/13789
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agomime: move examples to external test file
Andrew Gerrand [Sat, 22 Aug 2015 09:40:01 +0000 (10:40 +0100)]
mime: move examples to external test file

Fixes #11257

Change-Id: I3f75db47b0f8e877d81e3c2dcea01ff747b47685
Reviewed-on: https://go-review.googlesource.com/13779
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile: in usage messages, name the binary "compile" instead of "Xg"
Brad Fitzpatrick [Sat, 22 Aug 2015 11:29:33 +0000 (20:29 +0900)]
cmd/compile: in usage messages, name the binary "compile" instead of "Xg"

Fixes #12227

Change-Id: I7c1b93e50736185a641fb637000aae2f15bc04ed
Reviewed-on: https://go-review.googlesource.com/13820
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agohtml: speed up UnescapeString
Ingo Oeser [Sat, 9 May 2015 15:55:05 +0000 (17:55 +0200)]
html: speed up UnescapeString

Add benchmarks for for sparsely escaped and densely escaped strings.
Then speed up the sparse unescaping part heavily by using IndexByte and
copy to skip the parts containing no escaping very fast.

Unescaping densely escaped strings slower because of
the new function call overhead. But sparsely encoded strings are seen
more often in the utf8 enabled web.

We win part of the speed back by looking up entityName differently.

benchmark                  old ns/op    new ns/op    delta
BenchmarkEscape                31680        31396   -0.90%
BenchmarkEscapeNone             6507         6872   +5.61%
BenchmarkUnescape              36481        48298  +32.39%
BenchmarkUnescapeNone            332          325   -2.11%
BenchmarkUnescapeSparse         8836         3221  -63.55%
BenchmarkUnescapeDense         30639        32224   +5.17%

Change-Id: If606cb01897a40eefe35ba98f2ff23bb25251606
Reviewed-on: https://go-review.googlesource.com/10172
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agotime: Use AppendFormat in Marshal[Text|JSON]
Justin Nuß [Sun, 31 May 2015 11:17:59 +0000 (13:17 +0200)]
time: Use AppendFormat in Marshal[Text|JSON]

The current implementations of MarshalJSON and MarshalText use
time.Format which returns a string (converted from a byte slice),
only to convert it back to a byte slice.

Avoid the conversion (and thus an allocation) by directly appending
the formatted time to a preallocated byte slice, using the new
AppendFormat function, introduced in golang.org/cl/1760.

This reduces the allocations done in Marshal[Text|JSON] by 50%.

benchmark                old ns/op     new ns/op     delta
BenchmarkMarshalJSON     626           507           -19.01%
BenchmarkMarshalText     598           511           -14.55%

benchmark                old allocs     new allocs     delta
BenchmarkMarshalJSON     2              1              -50.00%
BenchmarkMarshalText     2              1              -50.00%

benchmark                old bytes     new bytes     delta
BenchmarkMarshalJSON     96            48            -50.00%
BenchmarkMarshalText     96            48            -50.00%

Fixes #11025

Change-Id: I468f78d075a6ecc1cdc839df7fb407fbc6ff2e70
Reviewed-on: https://go-review.googlesource.com/10555
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals
Brad Fitzpatrick [Sat, 30 May 2015 22:08:46 +0000 (15:08 -0700)]
cmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals

Safer, more readable, shorter.

Change-Id: I5cf1f438e20a3df45fc43cc5c870a533f7c524bf
Reviewed-on: https://go-review.googlesource.com/10517
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: allow huge rsh in constants arithmetic
Alberto Donizetti [Thu, 20 Aug 2015 15:53:41 +0000 (17:53 +0200)]
cmd/compile: allow huge rsh in constants arithmetic

Currently an expression like

var v = 0 >> 1000

is rejected by gc with a "stupid shift" error, while gotype
compiles it successfully.

As suggested by gri on the issue tracker, allow an rsh right
operand to be any valid uint value.

Fixes #11328

Change-Id: I6ccb3b7f842338d91fd26ae37dd4fa279d7fc440
Reviewed-on: https://go-review.googlesource.com/13777
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agocmd/compile/internal/big: update vendored math/big
Robert Griesemer [Fri, 21 Aug 2015 18:33:25 +0000 (11:33 -0700)]
cmd/compile/internal/big: update vendored math/big

This updates the big package used by the compiler to match the
public big package which contains some updates and bug fixes.
Obtained by running vendor.bash in the internal/big directory.
No manual changes.

Change-Id: I299aecc6599d4a745a721ce48def32449640dbb2
Reviewed-on: https://go-review.googlesource.com/13815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/big: fix TestBytes test
Robert Griesemer [Fri, 21 Aug 2015 18:30:19 +0000 (11:30 -0700)]
math/big: fix TestBytes test

Fixes #12231.

Change-Id: I1f07c444623cd864667e21b2fee534eacdc193bb
Reviewed-on: https://go-review.googlesource.com/13814
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/trace: don't fail when no browser is available
David du Colombier [Fri, 21 Aug 2015 18:31:50 +0000 (20:31 +0200)]
cmd/trace: don't fail when no browser is available

When there is no browser available on the system,
we should print the URL instead of failing.

Change-Id: I4a2b099e17609394273eff150062c285d76bbac1
Reviewed-on: https://go-review.googlesource.com/13774
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agomath/big: correctly handle large exponent in SetString
Alberto Donizetti [Fri, 21 Aug 2015 17:17:18 +0000 (19:17 +0200)]
math/big: correctly handle large exponent in SetString

Even though the umul/uquo functions expect two valid, finite big.Floats
arguments, SetString was calling them with possibly Inf values, which
resulted in bogus return values.

Replace umul and udiv calls with Mul and Quo calls to fix this. Also,
fix two wrong tests.

See relevant issue on issue tracker for a detailed explanation.

Fixes #11341

Change-Id: Ie35222763a57a2d712a5f5f7baec75cab8189a53
Reviewed-on: https://go-review.googlesource.com/13778
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agomath/big: remove superfluous comparison
Robert Griesemer [Fri, 19 Jun 2015 17:49:42 +0000 (10:49 -0700)]
math/big: remove superfluous comparison

This is not a functional change.

Also:
- minor cleanups, better comments
- uniform spelling of noun "zeros" (per OED)

Fixes #11277.

Change-Id: I1726f358ce15907bd2410f646b02cf8b11b919cd
Reviewed-on: https://go-review.googlesource.com/11267
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoruntime/cgo: remove __stack_chk_fail_local
Hyang-Ah (Hana) Kim [Thu, 13 Aug 2015 13:05:22 +0000 (09:05 -0400)]
runtime/cgo: remove __stack_chk_fail_local

I cannot find where it's being used.

This addresses a duplicate symbol issue encountered in golang/go#9327.

Change-Id: I8efda45a006ad3e19423748210c78bd5831215e0
Reviewed-on: https://go-review.googlesource.com/13615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime, syscall: remove unused bits from Solaris implementation
Shawn Walker-Salas [Thu, 30 Jul 2015 20:32:55 +0000 (13:32 -0700)]
runtime, syscall: remove unused bits from Solaris implementation

CL 9184 changed the runtime and syscall packages to link Solaris binaries
directly instead of using dlopen/dlsym but did not remove the unused (and
now broken) references to dlopen, dlclose, and dlsym.

Fixes #11923

Change-Id: I36345ce5e7b371bd601b7d48af000f4ccacd62c0
Reviewed-on: https://go-review.googlesource.com/13410
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
9 years agodoc: fix typo in release notes
Rob Pike [Thu, 20 Aug 2015 01:46:05 +0000 (11:46 +1000)]
doc: fix typo in release notes

Change-Id: I5310cef72e714b22bcf2ae9e6fd85dbb7e8a15a2
Reviewed-on: https://go-review.googlesource.com/13787
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoall: fix some vet-caught formatting errors, mostly but not only in tests
Rob Pike [Tue, 11 Aug 2015 05:29:40 +0000 (15:29 +1000)]
all: fix some vet-caught formatting errors, mostly but not only in tests

Could go in 1.5, although not critical.
See also #12107

Change-Id: I7f1608b58581d21df4db58f0db654fef79e33a90
Reviewed-on: https://go-review.googlesource.com/13481
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agogo/types: fix complex(a, b) for untyped arguments a, b
Robert Griesemer [Thu, 30 Jul 2015 22:00:50 +0000 (15:00 -0700)]
go/types: fix complex(a, b) for untyped arguments a, b

R=1.6

Fixes #11669.

Change-Id: Id39e5401e991e46f014eb16b747f5d9b7b55b46a
Reviewed-on: https://go-review.googlesource.com/12937
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agogo/types: don't crash for erroneous program involving a shift in a declaration cycle
Robert Griesemer [Tue, 28 Jul 2015 22:44:19 +0000 (15:44 -0700)]
go/types: don't crash for erroneous program involving a shift in a declaration cycle

R=1.6

Fixes #11347.

Change-Id: Ic6b09f38682500ffcc8d1f96e58f7237a7528806
Reviewed-on: https://go-review.googlesource.com/12812
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agogo/types: convert untyped switch expressions to default type
Robert Griesemer [Mon, 27 Jul 2015 22:23:17 +0000 (15:23 -0700)]
go/types: convert untyped switch expressions to default type

R=1.6

Fixes #11667.
Fixes #11687.

Change-Id: I060db212e8e0ee35fdefb4d482398f8f71650b38
Reviewed-on: https://go-review.googlesource.com/12713
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoos/user: don't depend on _SC_GETPW_R_SIZE_MAX on Linux
Dominik Honnef [Sun, 21 Jun 2015 18:07:29 +0000 (20:07 +0200)]
os/user: don't depend on _SC_GETPW_R_SIZE_MAX on Linux

Even Linux systems may not have _SC_GETPW_R_SIZE_MAX if using a
different libc than glibc (e.g. musl). Instead of having special-cases
for the BSDs, handle -1 correctly by always using a default buffer size.

Fixes #11319.

Change-Id: I8b1b260eb9830e6dbe7667f3f33d115ae4de4ce8
Reviewed-on: https://go-review.googlesource.com/13772
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoencoding/base64: fix copy-paste-o bug in RawURLEncoding docs
Brad Fitzpatrick [Fri, 21 Aug 2015 02:06:04 +0000 (11:06 +0900)]
encoding/base64: fix copy-paste-o bug in RawURLEncoding docs

Fixes #12244

Change-Id: Iee4e45d9bca0718c71fcc574bc51b2084c3dcb2a
Reviewed-on: https://go-review.googlesource.com/13783
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agonet/http: document that [ListenAnd]Serve always returns a non-nil error
Andrew Gerrand [Thu, 20 Aug 2015 11:56:24 +0000 (11:56 +0000)]
net/http: document that [ListenAnd]Serve always returns a non-nil error

Fixes #12229

Change-Id: I243e39f67748e6754fb7726b21b3afc1ff436771
Reviewed-on: https://go-review.googlesource.com/13780
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: fix vendoredImportPath comment
David Glasser [Wed, 19 Aug 2015 17:38:54 +0000 (10:38 -0700)]
cmd/go: fix vendoredImportPath comment

Change-Id: I1650124dd459dc401ccd73943ff7287b1b8c57e4
Reviewed-on: https://go-review.googlesource.com/13689
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: document Go 1.5 on release page
Russ Cox [Wed, 19 Aug 2015 03:55:28 +0000 (23:55 -0400)]
doc: document Go 1.5 on release page

This makes sure the release page in the release will mention the release.

Fixes #12102.

Change-Id: I36befd7dba7ba9e70ae3335e21c8841179ac4eff
Reviewed-on: https://go-review.googlesource.com/13490
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet: respect go vs cgo resolver selection in all lookup routines
Russ Cox [Wed, 19 Aug 2015 02:50:12 +0000 (22:50 -0400)]
net: respect go vs cgo resolver selection in all lookup routines

This is especially important for LookupAddr, which used to be pure Go
(lightweight, one goroutine per call) and without this CL is now
unconditionally cgo (heavy, one thread per call).

Fixes #12190.

Change-Id: I43436a942bc1838b024225893e156f280a1e80cf
Reviewed-on: https://go-review.googlesource.com/13698
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: force LookupAddr results to be rooted DNS paths when using cgo
Russ Cox [Wed, 19 Aug 2015 02:19:58 +0000 (22:19 -0400)]
net: force LookupAddr results to be rooted DNS paths when using cgo

Go 1.4 and before have always returned DNS names with a trailing dot
for reverse lookups, as they do for basically all other routines returning
DNS names. Go 1.4 and before always implemented LookupAddr using
pure Go (not C library calls).

Go 1.5 added the ability to make a C library call to implement LookupAddr.
Unfortunately the C library call returns a DNS name without a trailing dot
(an unrooted name), meaning that if turn off cgo during make.bash then
you still get the rooted name but with cgo on you get an unrooted name.
The unrooted name is inconsistent with the pure Go implementation
and with all previous Go releases, so change it to a rooted name.

Fixes #12189.

Change-Id: I3d6b72277c121fe085ea6af30e5fe8019fc490ad
Reviewed-on: https://go-review.googlesource.com/13697
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet: document GODEBUG=netdns=xxx settings
Russ Cox [Wed, 19 Aug 2015 03:19:41 +0000 (23:19 -0400)]
net: document GODEBUG=netdns=xxx settings

Fixes #12191.

Change-Id: I5c7659ccb0566dad3613041d9e76be87ceacae61
Reviewed-on: https://go-review.googlesource.com/13700
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: fix typos in go1.5.html
Rob Pike [Wed, 19 Aug 2015 03:44:33 +0000 (13:44 +1000)]
doc: fix typos in go1.5.html

Thanks to Nathan Youngman for spotting them.

Change-Id: I1856527af66a5d1965265ec3dcd639d3f6d74bcc
Reviewed-on: https://go-review.googlesource.com/13711
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5.html: refer to ppc64 as 64-bit PowerPC, not Power 64
Russ Cox [Tue, 18 Aug 2015 01:32:40 +0000 (21:32 -0400)]
doc/go1.5.html: refer to ppc64 as 64-bit PowerPC, not Power 64

Saying "Power 64" was wrong for reasons I don't remember.
(Those reasons are why we stopped using GOARCH=power64.)

Change-Id: Ifaac78d5733bfc780df01b1a66da766af0b17726
Reviewed-on: https://go-review.googlesource.com/13675
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: adjust binary install page supported system list
Russ Cox [Tue, 18 Aug 2015 15:15:15 +0000 (11:15 -0400)]
doc: adjust binary install page supported system list

Make clear that this list is the list of supported systems
for binary distributions, and that other systems may be
able to build the distribution from source, in addition
to using gccgo.

Drop freebsd/arm from the list on this page.
We have never issued a binary distribution for freebsd/arm,
and we're not going to start in Go 1.5, since we don't even
have a working builder for it.

Drop freebsd/386 from the list on the page,
because we are unable to build binary distributions, per adg.

I think the wording here should probably be revised further,
but not now.

Change-Id: Ib43b6b64f5c438bfb9aa4d3daa43393f1e33b71f
Reviewed-on: https://go-review.googlesource.com/13690
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/vet: power64 is now ppc64
Russ Cox [Tue, 18 Aug 2015 13:58:24 +0000 (09:58 -0400)]
cmd/vet: power64 is now ppc64

This was missed when we did the rename months ago
because cmd/vet did not live in the main tree.
Now vet's asmdecl checks will apply to ppc64 assembly too.

Change-Id: I687cba89fef702f29dd118de76a7ca1041c414f6
Reviewed-on: https://go-review.googlesource.com/13677
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: really skip TestNoteReading on linux/ppc64le
Russ Cox [Tue, 18 Aug 2015 15:40:59 +0000 (11:40 -0400)]
cmd/go: really skip TestNoteReading on linux/ppc64le

Change-Id: Iaeba7c55bbb9e11ac30f3b61369aa597acc30190
Reviewed-on: https://go-review.googlesource.com/13691
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: disable TestNoteReading on solaris, linux/ppc64le
Russ Cox [Tue, 18 Aug 2015 14:59:30 +0000 (10:59 -0400)]
cmd/go: disable TestNoteReading on solaris, linux/ppc64le

Update #11184 (linux/ppc64).
Filed #12178 (solaris) for Go 1.6.

Change-Id: I9e3a456aaccb49590ad4e14b53ddfefca5b0801c
Reviewed-on: https://go-review.googlesource.com/13679
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: fix interaction between GOEXPERIMENT=fieldtrack and race detector
Russ Cox [Tue, 18 Aug 2015 01:38:46 +0000 (21:38 -0400)]
cmd/compile: fix interaction between GOEXPERIMENT=fieldtrack and race detector

Tested by hand.
Only lines of code changing are protected by Fieldtrack_enabled > 0,
which is never true in standard Go distributions.

Fixes #12171.

Change-Id: I963b9997dac10829db8ad4bfc97a7d6bf14b55c6
Reviewed-on: https://go-review.googlesource.com/13676
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix vendor-related index out of range panic on bad file tree
Russ Cox [Tue, 18 Aug 2015 01:26:45 +0000 (21:26 -0400)]
cmd/go: fix vendor-related index out of range panic on bad file tree

Fixes #12156.

Change-Id: I2d71163b98bcc770147eb9e78dc551a9d0b5b817
Reviewed-on: https://go-review.googlesource.com/13674
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix spurious rebuild of binaries using cgo on OS X
Russ Cox [Tue, 18 Aug 2015 00:47:29 +0000 (20:47 -0400)]
cmd/go: fix spurious rebuild of binaries using cgo on OS X

The text segment starts farther into the binary when using
external linking on the mac. Test and fix.

Fixes #12173.

Change-Id: I1f0c81814bf70cd9decfceac3022784f4608eeef
Reviewed-on: https://go-review.googlesource.com/13672
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/yacc: fix compile error in empty grammar
Russ Cox [Tue, 18 Aug 2015 00:54:05 +0000 (20:54 -0400)]
cmd/yacc: fix compile error in empty grammar

Fixes #12154.

Change-Id: I1e6d1a3479a8a6fc8f53aebd18fb142506110809
Reviewed-on: https://go-review.googlesource.com/13673
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet/http: fix races cloning TLS config
Brad Fitzpatrick [Tue, 11 Aug 2015 20:22:57 +0000 (23:22 +0300)]
net/http: fix races cloning TLS config

Found in a Google program running under the race detector.
No test, but verified that this fixes the race with go run -race of:

package main

import (
        "crypto/tls"
        "fmt"
        "net"
        "net/http"
        "net/http/httptest"
)

func main() {
        for {
                ts := httptest.NewTLSServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {}))
                conf := &tls.Config{} // non-nil
                a, b := net.Pipe()
                go func() {
                        sconn := tls.Server(a, conf)
                        sconn.Handshake()
                }()
                tr := &http.Transport{
                        TLSClientConfig: conf,
                }
                req, _ := http.NewRequest("GET", ts.URL, nil)
                _, err := tr.RoundTrip(req)
                println(fmt.Sprint(err))
                a.Close()
                b.Close()
                ts.Close()
        }
}

Also modified cmd/vet to report the copy-of-mutex bug statically
in CL 13646, and fixed two other instances in the code found by vet.
But vet could not have told us about cloneTLSConfig vs cloneTLSClientConfig.

Confirmed that original report is also fixed by this.

Fixes #12099.

Change-Id: Iba0171549e01852a5ec3438c25a1951c98524dec
Reviewed-on: https://go-review.googlesource.com/13453
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>

9 years agodoc: only the Logger.SetOutput method is new in Go 1.5
Ian Lance Taylor [Sun, 16 Aug 2015 19:20:31 +0000 (12:20 -0700)]
doc: only the Logger.SetOutput method is new in Go 1.5

The SetOutput function has been there since Go 1.

Fixes #12162.

Change-Id: I66210374877581e42689f9943532141659a55ca7
Reviewed-on: https://go-review.googlesource.com/13637
Reviewed-by: Rob Pike <r@golang.org>
9 years agosort: Fix typo in Stable() comment
Matt Bostock [Sun, 16 Aug 2015 21:10:45 +0000 (22:10 +0100)]
sort: Fix typo in Stable() comment

Correct 'an' to 'on' in the comment above the Stable() function.

Change-Id: I714e38b2d3a79dfd539d5368967d1c6b519cb948
Reviewed-on: https://go-review.googlesource.com/13662
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/compile/internal/arm64: remove Reginuse check in clearfat
Dave Cheney [Sat, 15 Aug 2015 05:25:46 +0000 (15:25 +1000)]
cmd/compile/internal/arm64: remove Reginuse check in clearfat

Fixes golang/go#12133

CL 13630 fixed the use of a stale reg[] array in the various arch
backends which was causing the check in clearfat to pass
unconditionally on arm64.

With this check fixed, arm64 now considers REGRT1 to always be in use
as it is part of the reserved register set, see arm64/gsubr.go.

However, ppc64 does not consider REGRT1 and REGRT2 to be part of its
reserved set, so its identical clearfat check passes.

This CL removes the Reginuse check inside clearfat as REGRT1 is
guarenteed always be free on arm64.

Change-Id: I4719150d3c3378fae155b863c474529df18d4c17
Reviewed-on: https://go-review.googlesource.com/13650
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/trace: fix static file reference
Dmitry Vyukov [Wed, 12 Aug 2015 19:26:25 +0000 (21:26 +0200)]
cmd/trace: fix static file reference

Use runtime.GOROOT instead of os.Getenv("GOROOT") to reference
trace-viewer html file. GOROOT env var is not necessary set,
runtime.GOROOT has a default value for such case.

Change-Id: I906a720f6822915bd9575756e6cbf6d622857c2b
Reviewed-on: https://go-review.googlesource.com/13593
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: make "go test" recognize -exec flag again.
Rahul Chaudhry [Thu, 13 Aug 2015 22:39:43 +0000 (15:39 -0700)]
cmd/go: make "go test" recognize -exec flag again.

Fixes #12144.

Change-Id: I112c6517371215c9797db8f1dffca0f3047c39e3
Reviewed-on: https://go-review.googlesource.com/13633
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: remove stale register use array
Keith Randall [Thu, 13 Aug 2015 19:25:19 +0000 (12:25 -0700)]
cmd/compile: remove stale register use array

The reg[] array in .../gc is where truth lies.  The copy in .../ARCH
is incorrect as it is mostly not updated to reflect regalloc decisions.

This bug was introduced in the rewrite
https://go-review.googlesource.com/#/c/7853/.  The new reg[] array was
introduced in .../gc but not all of the uses were removed in the
.../ARCH directories.

Fixes #12133

Change-Id: I6364fc403cdab92d802d17f2913ba1607734037c
Reviewed-on: https://go-review.googlesource.com/13630
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile/internal/ppc64: disable DUFFZERO
Dave Cheney [Tue, 11 Aug 2015 21:55:01 +0000 (07:55 +1000)]
cmd/compile/internal/ppc64: disable DUFFZERO

Update #12108

If DUFFZERO is used within a tail call method it will overwrite the
link register.

Change-Id: I6abd2fde0f0ad909ccd55eb119b992673a74f0e2
Reviewed-on: https://go-review.googlesource.com/13570
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: run test binaries in original environment
Russ Cox [Tue, 11 Aug 2015 14:35:30 +0000 (10:35 -0400)]
cmd/go: run test binaries in original environment

Fixes #12096.
Followup to CL 12483, which fixed #11709 and #11449.

Change-Id: I9031ea36cc60685f4d6f65c39f770c89b3e3395a
Reviewed-on: https://go-review.googlesource.com/13449
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix addition of "math" dependency for arm binaries
Russ Cox [Tue, 11 Aug 2015 14:33:25 +0000 (10:33 -0400)]
cmd/go: fix addition of "math" dependency for arm binaries

p.ImportPath is the directory-derived path (like cmd/go).
p.Name is the actual package name.

Fixes #12089.

Change-Id: Ief76d42a85f811b0dfe2218affb48551527a7d44
Reviewed-on: https://go-review.googlesource.com/13530
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd/link: make -a output not crash
Russ Cox [Tue, 11 Aug 2015 14:59:24 +0000 (10:59 -0400)]
cmd/link: make -a output not crash

Fixes #12107.

Change-Id: I62f1b6ac9fb6f2cfa3472253dc1c6f7b7d2a6faf
Reviewed-on: https://go-review.googlesource.com/13448
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agonet/mail: fix build.
David Symonds [Tue, 11 Aug 2015 06:36:40 +0000 (16:36 +1000)]
net/mail: fix build.

Change-Id: I8f5c72c6c0db015c06d564523bab35d97d934578
Reviewed-on: https://go-review.googlesource.com/13510
Reviewed-by: Michael McGreevy <mcgreevy@golang.org>
Reviewed-by: David Symonds <dsymonds@golang.org>
9 years agonet/mail: avoid panic in (*Address).String for malformed addresses.
David Symonds [Tue, 11 Aug 2015 05:05:12 +0000 (15:05 +1000)]
net/mail: avoid panic in (*Address).String for malformed addresses.

Fixes #12098.

Change-Id: I190586484cd34856dccfafaba60eff0197c7dc20
Reviewed-on: https://go-review.googlesource.com/13500
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/yacc: use %q to print strings in Toknames
Rob Pike [Mon, 10 Aug 2015 05:17:18 +0000 (15:17 +1000)]
cmd/yacc: use %q to print strings in Toknames

Fixes #12086

Belongs in 1.5

There remains a question of why the Statenames table's elements
are not printed. What purpose does that serve?

Change-Id: I83fd57b81d5e5065c3397a66ed457fc0d1c041bd
Reviewed-on: https://go-review.googlesource.com/13462
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
9 years agodoc: link to Go 1.5 release notes from "project" page
Andrew Gerrand [Mon, 10 Aug 2015 23:30:20 +0000 (23:30 +0000)]
doc: link to Go 1.5 release notes from "project" page

Update issue #12102.

Change-Id: I9cafb284a848cc053bc7e5479c53ebf889b6d4d9
Reviewed-on: https://go-review.googlesource.com/13480
Reviewed-by: Rob Pike <r@golang.org>
9 years agofmt: don't unread eof scanning %x
Rob Pike [Mon, 10 Aug 2015 03:21:28 +0000 (13:21 +1000)]
fmt: don't unread eof scanning %x

When scanning a hex byte at EOF, the code was ungetting the eof,
which backed up the input and caused double-scanning of a byte.

Delete the call to UnreadRune.

This line appeared in 1.5 for some reason; it was not in 1.4 and
should be removed again for 1.5

Fixes #12090.

Change-Id: Iad1ce8e7db8ec26615c5271310f4b0228cca7d78
Reviewed-on: https://go-review.googlesource.com/13461
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: NaCl requires pepper 41
Dave Cheney [Fri, 7 Aug 2015 00:52:18 +0000 (10:52 +1000)]
doc: NaCl requires pepper 41

Fixes #12062
Updates #11961

The sRPC nameservice was removed in pepper 42. For Go 1.5 stipulate
that NaCl requires pepper 41 only.

Change-Id: Ic88ba342d41f673391efaa96fb581712fa10a0fd
Reviewed-on: https://go-review.googlesource.com/13341
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: make sure heapBitsBulkBarrier cannot be preempted
Russ Cox [Fri, 7 Aug 2015 17:34:56 +0000 (13:34 -0400)]
runtime: make sure heapBitsBulkBarrier cannot be preempted

Changes the torture test in #12068 from failing about 1/10 times
to not failing in almost 2,000 runs.

This was only happening in -race mode because functions are
bigger in -race mode, so a few of the helpers for heapBitsBulkBarrier
were not being inlined, and they were not marked nosplit,
so (only in -race mode) the write barrier was being preempted by GC,
causing missed pointer updates.

Filed issue #12069 for diagnosis of any other similar errors.

Fixes #12068.

Change-Id: Ic174d9b050ba278b18b08ab0d85a73c33bd5b175
Reviewed-on: https://go-review.googlesource.com/13364
Reviewed-by: Austin Clements <austin@google.com>