««« backport 1f62df249175
math, runtime: use a NaN that matches gcc's
our old choice is not working properly at least on VFPv2 in
ARM1136JF-S (it's not preserved across float64->float32 conversions).
Fixes#3745.
R=dave, rsc
CC=golang-dev
https://golang.org/cl/6344078
»»»
««« backport 75a21418ac8f
net: fix TCPListener file leak to child processes
Hold ForkLock during dup of fd + cloexec in the net pkg,
per the locking policy documented in syscall/exec_unix.go.
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/6457080
»»»
««« backport 9e2011d9ed4b
bufio: discourage use of ReadLine
Too many people use it without reading what it does.
Those people want ReadBytes or ReadString.
Fixes#3906.
R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/6442087
»»»
««« backport d68605d10a6b
cmd/gc: accept switches on comparable arrays.
The compiler is incorrectly rejecting switches on arrays of
comparable types. It also doesn't catch incomparable structs
when typechecking the switch, leading to unreadable errors
during typechecking of the generated code.
Fixes#3894.
R=rsc
CC=gobot, golang-dev, r, remy
https://golang.org/cl/6442074
»»»
««« backport 32eb6dac3ff4
os: test that IsExist and IsNotExist handle PathError and LinkError
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6442080
»»»
««« backport d134e30c4d29
go/ast: ast.Print must not crash with unexported fields
Don't print unexported struct fields; their values are
not accessible via reflection.
Fixes#3898.
Also:
- added support for arrays
- print empty maps, arrays, slices, structs on one line
for a denser output
- added respective test cases
R=r
CC=golang-dev
https://golang.org/cl/6454089
»»»
««« backport d872ed20fccb
cmd/gc: fix inlining bug with receive operator.
The receive operator was given incorrect precedence
resulting in incorrect deletion of parentheses.
Fixes#3843.
R=rsc
CC=golang-dev, remy
https://golang.org/cl/6442049
»»»
««« backport aeaab9df5600
cmd/cgo: use 1 as last entry for __cgodebug_data
LLVM-based gcc will place all-zero data in a zero-filled
section, but our debug/macho can't handle that.
Fixes#3821.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6444049
»»»
««« backport 2307a931664e
net/http: don't allow zero byte in FileServer paths
Should probably be fixed in the syscall package, either
additional or instead of this CL.
Fixes#3842
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6442061
»»»
««« backport 98788e8973f2
cmd/gc: point "no new variables" error at right line number.
Fixes#3856.
R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/6455056
»»»
««« backport d191515c80fb
syscall: apply comment from Mikioh
This comment was suggested in CL 6456045
but never got applied.
R=mikioh, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6447056
»»»
««« backport 0eae95b0307a
syscall: workaround accept() bug on Darwin
Darwin kernels have a bug in accept() where error result from
an internal call is not checked and socket is accepted instead
of ECONNABORTED error. However, such sockets have no sockaddr,
which results in EAFNOSUPPORT error from anyToSockaddr, making
Go http servers running on Mac OS X easily susceptible to
denial of service from simple port scans with nmap.
Fixes#3849.
R=golang-dev, adg, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6456045
»»»
««« backport 9bf2225c38eb
misc/vim: fix :Import insertion heuristic.
If a factored import group has a blank line, assume it is dividing
separate groups of imports (e.g. standard library vs. site-specific).
import (
"bytes"
"io"
"mycorp/package"
)
The most common case is inserting new standard library imports,
which are usually (stylistically) the first group, so we should drop
"net" in the above example immediately after "io".
Since this logic is getting non-trivial, add a test.
R=golang-dev, minux.ma, franciscossouza
CC=golang-dev
https://golang.org/cl/6445043
»»»
««« backport 6556a8d85dd6
log/syslog: don't append \n if there is one
pkg log already appends a linefeed to the log message,
so log/syslog doesn't need to append another.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6441048
»»»
««« backport d127749038e8
os: move epipecheck from file_posix.go and into file_unix.go to fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/6450058
»»»
««« backport bfa4e1f1027f
runtime: ignore signal 33 == SIGSETXID on GNU/Linux
When a cgo program calls setuid, setgid, etc., the GNU/Linux
pthread library sends signal SIGSETXID to each thread to tell
it to update its UID info. If Go is permitted to intercept
the default SIGSETXID signal handler, the program will hang.
This patch tells the runtime package to not try to intercept
SIGSETXID on GNU/Linux. This will be odd if a Go program
wants to try to use that signal, but it means that cgo
programs that call setuid, etc., won't hang.
Fixes#3871.
R=rsc, r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/6455050
»»»
««« backport 7f6a0510d3c9
go/printer: don't crash if ast.FuncType.Params is nil
The go/ast comment for FuncType.Params says that the field may be nil.
Make sure the printer accepts such a value. The go/parser always sets
the field (to provide parenthesis position information), but a program
creating a Go AST from scatch may not.
Added corresponding test case.
Fixes#3870.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6448060
»»»
««« backport 6751a0e1a6a4
cgo: fix declarations in _cgo_export.c
Declare crosscall2. Declare the functions passed to it as
returning void, rather than relying on implicit return type.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6432060
»»»
««« backport 7a67d277c7e8
testing: allow concurrent use of T and B
Notably, allow concurrent logging and failing.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6453045
»»»
««« backport 5a0aafb7fd8d
net: fix comment
RemoteAddr returns not only UDPAddr but IPAddr.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6401054
»»»
««« backport 0748cd92ed76
text/template: fix bug in map indexing
If the key is not present, return value of the type of the element
not the type of the key. Also fix a test that should have caught this case.
Fixes#3850.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6405078
»»»
««« backport 3357d8d34ab8
encoding/gob: revert 6348067, which broke compatibility
Add commentary to explain better what's going on, but the
code change is a simple one-line reversal to the previous
form.
R=rsc
CC=golang-dev
https://golang.org/cl/6428072
»»»