1
0
mirror of https://github.com/golang/go synced 2024-11-06 17:36:22 -07:00
Commit Graph

37055 Commits

Author SHA1 Message Date
Lynn Boger
30a63ecee3 runtime: restore r2 when restoring state from gobuf in gogo on ppc64x
When using plugins with goroutines calling cgo, we hit a case where
an intermittent SIGSEGV occurs when referencing an address that is based
on r2 (TOC address). When the failure can be generated in gdb, the
contents of r2 is wrong even though the value in the current stack's
slot for r2 is correct. So that means it somehow switched to start
running the code in this function without passing through the beginning
of the function which had the correct value of r2 and stored it there.

It was noted that in runtime.gogo when the state is restored from
gobuf, r2 is not restored from its slot on the stack. Adding the
instruction to restore r2 prevents the SIGSEGV.

This adds a testcase under testplugin which reproduces the problem if
the program is run multiple times. The team who reported this problem
has verified it fixes the issue on their larger, more complex
application.

Fixes #25756

Change-Id: I6028b6f1f8775d5c23f4ebb57ae273330a28eb8f
Reviewed-on: https://go-review.googlesource.com/117515
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-11 12:13:11 +00:00
Michael Munday
7ba0c6235f crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations
Hardware AES support in Go on s390x currently requires ECB, CBC
and CTR modes be available. It also requires that either the
GHASH or GCM facilities are available. The existing checks missed
some of these constraints.

While we're here simplify the cpu package on s390x, moving masking
code out of assembly and into Go code. Also, update SHA-{1,256,512}
implementations to use the cpu package since that is now trivial.

Finally I also added a test for internal/cpu on s390x which loads
/proc/cpuinfo and checks it against the flags set by internal/cpu.

Updates #25822 for changes to vet whitelist.

Change-Id: Iac4183f571643209e027f730989c60a811c928eb
Reviewed-on: https://go-review.googlesource.com/114397
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-11 11:41:31 +00:00
Tobias Klauser
40fc4bbfb8 net: skip TestSendfileParts on dragonfly and solaris
Skip it like on freebsd until there is proper a fix for #25809

Updates #25809

Change-Id: Id53c433aee75f2a992ab6a8d58d98fd1f8a6c1c6
Reviewed-on: https://go-review.googlesource.com/117698
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2018-06-11 08:16:18 +00:00
Alex Brainman
679690f348 net: add TestSendfileParts
Add test for freebsd issue #25809.

This test also fails on my Windows 10 Version 1803.
My hope is that adding new test will break one of our builders.

Updates #25722
Updates #25809

Change-Id: Ia103bc708b8fa3b9af57613acc44893f90b3fa18
Reviewed-on: https://go-review.googlesource.com/117775
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-11 06:35:20 +00:00
Thanabodee Charoenpiriyakij
b74f7321e5 syscall: update TOKEN_ALL_ACCESS according to WinNT.h
TOKEN_ALL_ACCESS was changed at some stage by Microsoft.

Updates #25775

Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b
Reviewed-on: https://go-review.googlesource.com/117635
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2018-06-11 00:45:20 +00:00
Agniva De Sarker
b3562658fd net/http: add application/wasm mime type
Although not part of http://mimesniff.spec.whatwg.org,
for WASM streaming compilation to happen, the response
needs to have the application/wasm MIME type
as mentioned here:
https://webassembly.github.io/spec/web-api/index.html#streaming-modules.

And all current browsers prevent streaming compilation
from happening if this MIME type is not present in the response.

The magic number is mentioned here:
https://webassembly.org/docs/binary-encoding

Since we are already adding WASM support, it makes sense
to support this MIME type.

Change-Id: I8dd7b413a8c438a5c23c29d843b42f6da2a20ba4
Reviewed-on: https://go-review.googlesource.com/113396
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-10 17:04:22 +00:00
Caleb Spare
a5f83037ae net/http/httptest: deprecate ResponseRecorder.HeaderMap
Users of this field are better off using Result instead.

Fixes #25763.

Change-Id: I4391afa6ed3873107628630adc1d409d77fb3f20
Reviewed-on: https://go-review.googlesource.com/117675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-10 05:49:55 +00:00
Alex Brainman
d67db88146 cmd/link: split pe .text section into .text and .rdata
Fixes #24725

Change-Id: I2864b88315ab15be036e8940d0a5884d876698d6
Reviewed-on: https://go-review.googlesource.com/115975
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-09 07:34:45 +00:00
Mark Rushakoff
1f137052e4 strconv: add missing period to godoc comment
Change-Id: I90ba0a6e0c6ccdce16938eed09424308a84fc6fb
GitHub-Last-Rev: 66b6db1a67
GitHub-Pull-Request: golang/go#25801
Reviewed-on: https://go-review.googlesource.com/117575
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-09 01:26:25 +00:00
Ian Lance Taylor
77d5c62815 cmd/go: add Solaris assembler syntax for gccgo buildid file
The Solaris assembler uses a different syntax for section directives.

Fixes https://gcc.gnu.org/PR85429.

Change-Id: I1e54dffee3290046dbb68ba4e90ab795c6b72571
Reviewed-on: https://go-review.googlesource.com/109140
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-08 22:44:03 +00:00
Iskander Sharipov
289ab30457 cmd/link: fix duplicated "unresolved inter-package jump" errors
This is extension to https://golang.org/cl/113955 that handled
duplicated "unresolved relocation" errors.

For platforms with trampoline support, additional error is generated
per each undefined symbol. This breaks TestUndefinedRelocErrors test
on these platforms.

Proposed fix:

	1. Changes error text to be identical to normal undefined reloc.
	   If relocation is undefined, jump to it will be unresolved
	   as well.

	2. Introduces a map that can be used by all sites that
	   handle this kind of errors which makes it easier
	   to report such errors exactly once.

Errors on ppc64 before this change (note first 4 lines):

	main.defined1: unresolved inter-package jump to main.undefined()
	main.defined1: unresolved inter-package jump to main.undefined()
	main.defined2: unresolved inter-package jump to main.undefined()
	main.defined2: unresolved inter-package jump to main.undefined()
	main.defined1: relocation target main.undefined not defined
	main.defined2: relocation target main.undefined not defined
	runtime.main_main·f: function main is undeclared in the main package

After this change:

	main.defined1: relocation target main.undefined not defined
	main.defined2: relocation target main.undefined not defined
	runtime.main_main·f: function main is undeclared in the main package

Because of (1), errors output is the same on all platforms now.

Fixes #25753

Change-Id: Ic3084202a6fc5d4a6d2d0a93344f012b37fe58ed
Reviewed-on: https://go-review.googlesource.com/116676
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-08 21:32:33 +00:00
Richard Musiol
96faeb0bb0 misc/wasm: set non-empty default for os.Args
os.Args is usually never empty and the flag package panics if it is.
This commit makes os.Args default to ["js"] for js/wasm.

Change-Id: Iba527145686487b052da438fca40159e57e61a81
Reviewed-on: https://go-review.googlesource.com/117475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-08 21:07:22 +00:00
philhofer
afae876b31 runtime: fix pprof livelock on arm
On 32-bit architectures without native 64-bit atomic instructions,
64-bit atomics are emulated using spinlocks. However,
the sigprof handling code expects to be able to perform
64-bit atomic operations in signal handlers. Spinning on an
acquired spinlock in a signal handler leads to a livelock.
This is issue #20146.

The original fix for #20146 did not include arm in
the list of architectures that need to work around portability
issues in the sigprof handler code. The unit test designed to
catch this issue does not fail on arm builds because arm uses
striped spinlocks, and thus the livelock takes many minutes
to reproduce. This is issue #24260. (This patch doesn't completely
fix #24260 on go1.10.2 due to issue #25785, which is probably
related to the arm cas kernel helpers. Those have been removed
at tip.)

With this patch applied, I was able to run the reproducer for
issue #24260 for more than 90 minutes without reproducing the
livelock. Without this patch, the livelock took as little as
8 minutes to reproduce.

Fixes #20146
Updates #24260

Change-Id: I64bf53a14d53c4932367d919ac55e17c99d87484
Reviewed-on: https://go-review.googlesource.com/117057
Run-TryBot: Philip Hofer <phofer@umich.edu>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-06-08 17:07:53 +00:00
David du Colombier
abeac0912a cmd/cover: fix TestCoverHTML on Plan 9
CL 116975 added TestCoverHTML. However, this test is failing
on Plan 9, because the GNU diff tool is called "ape/diff"
instead of "diff" on Plan 9.

This change replaces the "diff" command by the "ape/diff"
command on Plan 9.

Fixes #25795.

Change-Id: I15b49868cd09f3f977aa13fffdfc430c882bf757
Reviewed-on: https://go-review.googlesource.com/117415
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-08 09:35:10 +00:00
Keith Randall
29e5a81e28 cmd/compile: mark BS{F,R}L as clobbering flags
Turns out it doesn't currently matter, as these ops are always issued
together with a BTSL which does clobber flags. So I can't write a test
that currently fails. But better to be future-proof.

BS{F,R}Q generates flags, so it doesn't need to be marked as clobbering.

Change-Id: I70daea154023fd435fac696bf3a384803c647cd3
Reviewed-on: https://go-review.googlesource.com/117375
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-08 04:22:01 +00:00
David Symonds
1425412f38 cmd/cover: fix test on Solaris
Solaris diff doesn't know about -d (a.k.a. --minimal).

Change-Id: I86146b4b93e3d0bdea52a0fde59afca20b5bab51
Reviewed-on: https://go-review.googlesource.com/117335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-08 02:11:51 +00:00
David Symonds
aadaec5045 cmd/cover: fix sorting of profile segment boundaries, again
This is a refinement of CL 114855, which fixed the empty clause case,
but broke some other cases where segment boundaries can coincide
for other reasons.

Fixes #25767.

Change-Id: I2a387c83f9d651c8358f3e11b03f6167af0eb8bf
Reviewed-on: https://go-review.googlesource.com/116976
Run-TryBot: David Symonds <dsymonds@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-06-07 22:47:53 +00:00
Robert Griesemer
d8a1465ca8 go/types: extend cycle detection past simple type cycles
This change improves upon cycle detection by taking into account
cycles involving constants, variables, _and_ types. All new code
(except for the additional tests) is guarded by the useCycleMarking
(internal) flag and thus can be disabled on short notice if it
introduced new problems. (The intent is to remove this flag shortly
after 1.11 is released.)

The test suite has been extended with various additional (and mostly
esoteric) test cases which now correctly report cycles. A handful of
existing test cases now report additional errors, but those are mostly
esoteric cases. Overall, this is an improvement over the status quo.

Fixes #8699.
For #20770.

Change-Id: I6086719acd0d5200edca4a3dbe703d053496af31
Reviewed-on: https://go-review.googlesource.com/116815
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2018-06-07 22:04:21 +00:00
David Symonds
19f3794c00 cmd/cover: add test for HTML output
This adds a case for what was fixed in 4fe688c to prevent regression;
a follow-on change will address #25767.

Change-Id: Iced8cc10e2993ef7caf7e9c59ffbc7147d78ddd7
Reviewed-on: https://go-review.googlesource.com/116975
Run-TryBot: David Symonds <dsymonds@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 21:52:22 +00:00
David Symonds
17f54231e8 cmd/go: don't refuse to update a present package only because of its source configuration
If a package is checked out in the right place, but uses, for instance,
an unusual Git remote configuration, don't refuse to update just because
cmd/go can't parse it. In most cases, `git pull -ff-only` (or the
equivalent in other VCSes) works just fine.

Updates #25432.

Change-Id: I1952a0e6e03f185f34029b186e1756c9549689e1
Reviewed-on: https://go-review.googlesource.com/113456
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-06-07 21:50:50 +00:00
Filippo Valsorda
9417ff55c3 crypto/tls: expand docs on client-side session ticket support
Users are sometimes confused why session tickets are not enabled even if
SessionTicketsDisabled is false.

Change-Id: I3b783d2cf3eed693a3ad6acb40a8003db7e0b648
Reviewed-on: https://go-review.googlesource.com/117255
Reviewed-by: Adam Langley <agl@golang.org>
2018-06-07 21:15:41 +00:00
Bryan C. Mills
8cf579abf7 cmd/go: restore "go list" exit code for missing binary packages
Prior to CL 108156, "go list" exited with code 0 if there were missing binary packages.
Restore that behavior to fix the failing TestBinaryOnlyPackages.

Fixes golang/go#25784.

Change-Id: Iaeca6bcc840f5ac8f2a016cef131f5c59a8261a8
Reviewed-on: https://go-review.googlesource.com/117036
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-07 18:43:49 +00:00
Brad Fitzpatrick
7b08e619bb debug/pe: add IMAGE_FILE_MACHINE_ARM64
Fixes #20849

Change-Id: If2a330185aa7e95eb84dccdbc4c7f3e9b970cca1
Reviewed-on: https://go-review.googlesource.com/117056
Reviewed-by: Matti Moell <matti.moell@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 16:17:04 +00:00
Brad Fitzpatrick
0e1517c0b3 cmd/go: skip TestBinaryOnlyPackages until it's fixed
Updates #25784

Change-Id: I638eab82b026d3df89da532b5cc3f5c06b02d6c8
Reviewed-on: https://go-review.googlesource.com/117075
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 15:47:29 +00:00
Adam Langley
6269dcdc24 crypto: randomly read an extra byte of randomness in some places.
Code has ended up depending on things like RSA's key generation being
deterministic given a fixed random Reader. This was never guaranteed and
would prevent us from ever changing anything about it.

This change makes certain calls randomly (based on the internal
fastrand) read an extra byte from the random Reader. This helps to
ensure that code does not depend on internal details.

I've not added this call in the key generation of ECDSA and DSA because,
in those cases, key generation is so obvious that it probably is
acceptable to do the obvious thing and not worry about code that depends
on that.

This does not affect tests that use a Reader of constant bytes (e.g. a
zeroReader) because shifting such a stream is a no-op. The stdlib uses
this internally (which is fine because it can be atomically updated if
the crypto libraries change).

It is possible that external tests could be doing the same and would
thus break if we ever, say, tweaked the way RSA key generation worked.
I feel that addressing that would be more effort than it's worth.

Fixes #21915

Change-Id: I84cff2e249acc921ad6eb5527171e02e6d39c530
Reviewed-on: https://go-review.googlesource.com/64451
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 15:09:25 +00:00
Tobias Klauser
db4675f2de encoding/asn1: gofmt
CL 113837 introduced some changes which were not properly gofmt'ed, fix them.

Change-Id: I89329063f9c468238051e45380d752e66efdb939
Reviewed-on: https://go-review.googlesource.com/116895
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 15:01:06 +00:00
Zhou Peng
581ed192e5 internal/cpu: convert CRLF to LF line ending, and some superfulous space
Change-Id: Ie355f06e9be93d7f7501f697a94ff83d6d0826a2
Reviewed-on: https://go-review.googlesource.com/114556
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 14:59:49 +00:00
cch123
cf901a7240 runtime: fix typo in runqput comment
Change-Id: Idd88a1d9420545e3e326f8e3b57a38d8c7515555
GitHub-Last-Rev: 59528f5522
GitHub-Pull-Request: golang/go#25779
Reviewed-on: https://go-review.googlesource.com/116935
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 14:58:07 +00:00
Russ Cox
35778aa497 cmd/go: final edits for add go list -cgo and -export
These got lost because I violated the cardinal rule of Gerrit
which is never click the Submit button in the web UI.

Change-Id: I8ccdfb5d8691960f244941036d33fb5a5a3f0c9a
Reviewed-on: https://go-review.googlesource.com/117015
Reviewed-by: Russ Cox <rsc@golang.org>
2018-06-07 14:31:33 +00:00
Agniva De Sarker
156bbe283c cmd/go/internal: add wasm magic header
This is needed when we are re-building to the wasm target.

Fixes #25774

Change-Id: I5dc47bd7e56c8570b8d2485273ef0d10f2feac6f
Reviewed-on: https://go-review.googlesource.com/116915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-07 14:27:48 +00:00
Russ Cox
baf399b02e cmd/go: add go list -cgo and -export
We want package analysis tools to be able to ask cmd/go for
cgo-translated files and for the names of files holding export
type information, instead of reinventing that logic themselves.
Allow them to do so, with the new list -cgo and -export flags.

Change-Id: I860df530d8dcc130f1f328413381b5664cc81c3b
Reviewed-on: https://go-review.googlesource.com/108156
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-06-07 14:25:31 +00:00
Tobias Klauser
5f2b4f26aa runtime: remove unused darwinVersion and getDarwinVersion
They are unused since CL 114799.

Also remove consts _CTL_KERN and _KERN_OSRELEASE previously used by
getDarwinVersion.

Change-Id: I51b701e8effbe4dd4301b0e6d52e8885469032f4
Reviewed-on: https://go-review.googlesource.com/116955
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-07 13:42:50 +00:00
hellozee
e5f0c1f6c9 flag: removed the colon after "Usage" in the documentation
Removing the colon will make the "Usage" and "Command line flag syntax" in the docs, a header when interpreted by godoc.

Fixes #25749

Change-Id: Ifc5572e171db1aaef9775b1d6c86091a8f2528fd
GitHub-Last-Rev: 1b57973430
GitHub-Pull-Request: golang/go#25750
Reviewed-on: https://go-review.googlesource.com/116555
Reviewed-by: Rob Pike <r@golang.org>
2018-06-07 07:00:46 +00:00
212472270
33f1768381 crypto/cipher: replace NewGCMWithNonceAndTagSize with NewGCMWithTagSize
This function was added during the Go 1.11 dev cycle and isn't part of
the API compatibility promise yet.

In the previous implementation, NewGCMWithNonceAndTagSize was being used
as a helper function for NewGCM, NewGCMWithTagSize, and NewGCMWithNonceSize.
With the removal of Nonce size from the name and parameters, we needed to
add an unexported helper function newGCMWithNonceAndTagSize.

Fixes #24977

Change-Id: Ie70f2a192d0556c4f890deb62e68cff6bbbccd33
Reviewed-on: https://go-review.googlesource.com/116435
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-07 01:19:13 +00:00
David Chase
c08b01ecb4 cmd/compile: fix panic-okay-to-inline change; adjust tests
This line of the inlining tuning experiment
https://go-review.googlesource.com/c/go/+/109918/1/src/cmd/compile/internal/gc/inl.go#347
was incorrectly rewritten in a later patch to use the call
cost, not the panic cost, and thus the inlining of panic
didn't occur when it should.  I discovered this when I
realized that tests should have failed, but didn't.

Fix is to make the correct change, and also to modify the
tests that this causes to fail.  One test now asserts the
new normal, the other calls "ppanic" instead which is
designed to behave like panic but not be inlined.

Change-Id: I423bb7f08bd66a70d999826dd9b87027abf34cdf
Reviewed-on: https://go-review.googlesource.com/116656
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2018-06-06 20:35:23 +00:00
Robert Griesemer
d09d7627f3 go/types: add missing test case for https://golang.org/cl/116735
Missed this in the prior submit.

For #24182.

Change-Id: If8349d39c80b7ff57bc0c857985f9e52241321b8
Reviewed-on: https://go-review.googlesource.com/116775
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-06 19:46:38 +00:00
Robert Griesemer
ca8ec69ce6 go/types: don't report errors referring to invalid types or operands
Such errors are likely spurious and caused by previously reported
errors; they don't add valuable information. Simply drop them.

Fixes #24182.

Change-Id: I0ac48c41647c628aa7636b29eaedfd9d01913762
Reviewed-on: https://go-review.googlesource.com/116735
Reviewed-by: Alan Donovan <adonovan@google.com>
2018-06-06 19:20:12 +00:00
Eugene Kalinin
9e4c344c72 database/sql: update doc related to per-connection state
Fixes #25330

Change-Id: I41b5b3459ed7808d18112ec02d734e2268099a81
Reviewed-on: https://go-review.googlesource.com/116596
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
2018-06-06 18:18:20 +00:00
Suriyaa Sundararuban
235c5cf153 README: linkify some paths
Change-Id: I77e31954f6d92f769934843bbba9f990f330f50a
Reviewed-on: https://go-review.googlesource.com/116675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-06 18:07:01 +00:00
Tobias Klauser
11f6cb43a0 crypto/x509: use SecItemExport instead of deprecated SecKeychainItemExport
SecKeychainItemExport is deprecated as of macOS 10.7. The minimum
supported version is macOS 10.10, so use SecItemExport instead.

While at it also bump macosx-version-min to 10.10 and
__MAC_OS_X_VERSION_MAX_ALLOWED to 101300 (for macOS 10.13).

Tested on macOS 10.10, 10.11 and 10.12.

Updates #23122

Change-Id: Id4cd6a5cea93315791253dc248e40e5615760a6c
Reviewed-on: https://go-review.googlesource.com/116396
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-06 17:59:08 +00:00
Yury Smolsky
7c1f361e25 test: add comments for all test actions
Every action has a short annotation.
The errorCheck function has a comment adapted from errchk script.

Removed redundant assigments to tmpDir.

Change-Id: Ifdd1284de046a0ce2aad26bd8da8a8e6a7707a8e
Reviewed-on: https://go-review.googlesource.com/115856
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-06 15:12:32 +00:00
Richard Musiol
88dc4aee7c cmd/compile: fix OffPtr with negative offset on wasm
The wasm archtecture was missing a rule to handle OffPtr with a
negative offset. This commit makes it so OffPtr always gets lowered
to I64AddConst.

Fixes #25741

Change-Id: I1d48e2954e3ff31deb8cba9a9bf0cab7c4bab71a
Reviewed-on: https://go-review.googlesource.com/116595
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
2018-06-06 14:40:25 +00:00
Ian Lance Taylor
6decd3d984 reflect: add StructOf test case that gccgo used to fail
Updates #25284

Change-Id: I8ca382dd85b428ad6899d9277cf7f3ce34e35e9a
Reviewed-on: https://go-review.googlesource.com/116416
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2018-06-06 14:08:42 +00:00
Brad Fitzpatrick
2ce295e954 net/http: remove an allocation in ServeMux
Also, add a benchmark variant ("SkipServe") that only benchmarks the
ServeMux handler selection path.

name                  old time/op    new time/op    delta
ServeMux_SkipServe-4    74.2µs ± 2%    60.6µs ± 1%   -18.31%   (p=0.000 n=10+9)

name                  old alloc/op   new alloc/op   delta
ServeMux_SkipServe-4    2.62kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.000 n=10+10)

name                  old allocs/op  new allocs/op  delta
ServeMux_SkipServe-4       180 ± 0%        0 ±NaN%  -100.00%  (p=0.000 n=10+10)

Updates #25383

Change-Id: Icfbb3b977e309093d032e922d1b4f254df6f5955
Reviewed-on: https://go-review.googlesource.com/116378
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2018-06-06 01:47:31 +00:00
Dennis Kuhnert
ebb8a1f8e6 cmd/go: output coverage report even if there are no test files
When using test -cover or -coverprofile the output for "no test files"
is the same format as for "no tests to run".

Fixes #24570

Change-Id: If05609411676d42d94c1feac4bc839974fae2cc1
Reviewed-on: https://go-review.googlesource.com/115095
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-06 01:10:20 +00:00
Robert Griesemer
d159d6108c cmd/compile: terminate compilation if type-checking fails
There is no benefit in continuing compilation if there
are type-checking errors. This will increase robustness
of the compiler in the presence of errors.

Fixes #22909.

Change-Id: I1c70c667e5927646ba3d0f370e33705165620f12
Reviewed-on: https://go-review.googlesource.com/116335
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-06 00:15:51 +00:00
Filippo Valsorda
b0951aff8f doc: document Go 1.10.3
Change-Id: Ifc774bb9267baa773e91c617204329d3e04bd4b7
Reviewed-on: https://go-review.googlesource.com/116363
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-06-06 00:03:55 +00:00
Filippo Valsorda
bbf4a3024b doc: document Go 1.9.7
Change-Id: I10dededb41162a99dbc42792a9d314c6dabddcca
Reviewed-on: https://go-review.googlesource.com/116362
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-06-06 00:03:32 +00:00
Robert Griesemer
409a943f69 cmd/compile: avoid nil pointer deref in debugging output
Found while tracking down another issue.

Change-Id: If06eee72ce3e3f45dc00b3b68670e1e4d99c87a7
Reviewed-on: https://go-review.googlesource.com/116455
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-05 23:43:08 +00:00
Brad Fitzpatrick
db49f76dc5 net/http: document Transport.Dial concurrency
Fixes #25019

Change-Id: I715e3bb560b2a0301240cecb09a5126ab04a666e
Reviewed-on: https://go-review.googlesource.com/116375
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-05 20:31:21 +00:00