1
0
mirror of https://github.com/golang/go synced 2024-11-15 04:40:28 -07:00
Commit Graph

13093 Commits

Author SHA1 Message Date
Shenghou Ma
e8e3cc97d0 [release-branch.go1] doc: fix some HTML syntax errors
««« backport 4adee56240ac
doc: fix some HTML syntax errors

R=adg
CC=golang-dev
https://golang.org/cl/6458043

»»»
2012-09-22 05:54:30 +10:00
Shenghou Ma
ccc55fc069 [release-branch.go1] cmd/go: remove $WORK paths in generated binaries
««« backport c1ce95068533
cmd/go: remove $WORK paths in generated binaries
        Fixes #3748.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6357064

»»»
2012-09-22 05:54:30 +10:00
Shenghou Ma
39a2841980 [release-branch.go1] math, runtime: use a NaN that matches gcc's
««« 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

»»»
2012-09-22 05:54:29 +10:00
Shenghou Ma
c469cb7c5d [release-branch.go1] runtime: remove unnecessary ROUND in alg.c
««« backport 4bd268b3c88a
runtime: remove unnecessary ROUND in alg.c
        Introduced in CL 6452046.

R=golang-dev, nigeltao, dave
CC=golang-dev
https://golang.org/cl/6459051

»»»
2012-09-22 05:54:29 +10:00
Andrew Gerrand
c645541691 [release-branch.go1] syscall: fix plan9 build broken by CL 6458050 2012-09-22 05:54:29 +10:00
Brad Fitzpatrick
1a07fca27d [release-branch.go1] net: fix TCPListener file leak to child processes
««« 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

»»»
2012-09-22 05:54:28 +10:00
Andrew Gerrand
b1de53a1f0 [release-branch.go1] syscall: return EINVAL when string arguments have NUL characters 2012-09-22 05:54:28 +10:00
Benny Siegert
1fe72f034f [release-branch.go1] syscall: add some new syscall numbers from NetBSD-current
««« backport 98c1ecd82cb5
syscall: add some new syscall numbers from NetBSD-current

R=golang-dev
CC=golang-dev
https://golang.org/cl/6454100

»»»
2012-09-22 05:54:27 +10:00
Russ Cox
a0e780b7ec [release-branch.go1] bufio: discourage use of ReadLine
««« 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

»»»
2012-09-22 05:54:27 +10:00
Rémy Oudompheng
64a3b18387 [release-branch.go1] cmd/8g: fix miscompilation due to BADWIDTH.
««« backport f6a6fe780649
cmd/8g: fix miscompilation due to BADWIDTH.

Fixes #3899.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6453084

»»»
2012-09-22 05:54:26 +10:00
Rémy Oudompheng
ab91d4fe2a [release-branch.go1] cmd/gc: accept switches on comparable arrays.
««« 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

»»»
2012-09-22 05:54:26 +10:00
Robert Griesemer
35b989ed7b [release-branch.go1] go/build: tiny cleanup
««« backport 30dfc01b473c
go/build: tiny cleanup

R=rsc
CC=golang-dev
https://golang.org/cl/6453083

»»»
2012-09-22 05:54:25 +10:00
Alex Brainman
524bb8d755 [release-branch.go1] os: test that IsExist and IsNotExist handle PathError and LinkError
««« backport 32eb6dac3ff4
os: test that IsExist and IsNotExist handle PathError and LinkError

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6442080

»»»
2012-09-22 05:54:25 +10:00
Robert Griesemer
40e77b01f5 [release-branch.go1] go/scanner: fix minor typo
««« backport c74762fb2e1d
go/scanner: fix minor typo

R=r
CC=golang-dev
https://golang.org/cl/6442076

»»»
2012-09-22 05:54:24 +10:00
Robert Griesemer
dda61d68c8 [release-branch.go1] go/ast: ast.Print must not crash with unexported fields
««« 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

»»»
2012-09-22 05:54:24 +10:00
Shenghou Ma
6425aa28f2 [release-branch.go1] runtime: round return value address in runtime.equal
««« backport a7752d169d2e
runtime: round return value address in runtime.equal
     Fixes #3866.

R=rsc, r, nigeltao
CC=golang-dev
https://golang.org/cl/6452046

»»»
2012-09-22 05:54:23 +10:00
Alex Brainman
6410538c72 [release-branch.go1] os: Rename error to fit IsExist
««« backport 104eb57df01b
os: Rename error to fit IsExist

Fixes #3828.

R=golang-dev, iant, rsc
CC=golang-dev
https://golang.org/cl/6420056

»»»
2012-09-22 05:54:23 +10:00
Rémy Oudompheng
bedafd2ddb [release-branch.go1] cmd/gc: fix inlining bug with receive operator.
««« 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

»»»
2012-09-22 05:54:22 +10:00
Shenghou Ma
82de010886 [release-branch.go1] cmd/cgo: use 1 as last entry for __cgodebug_data
««« 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

»»»
2012-09-22 05:54:22 +10:00
Rob Pike
ed3e546000 [release-branch.go1] regexp: fix glitch in doc for FindReaderIndex
««« backport 6f790a92b3d2
regexp: fix glitch in doc for FindReaderIndex
Fixes #3878.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6457054

»»»
2012-09-22 05:54:21 +10:00
Andrew Gerrand
31f6401799 [release-branch.go1] doc: remove mention of weekly tag from source install doc
««« backport 8c4b1b7ce761
doc: remove mention of weekly tag from source install doc

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/6442062

»»»
2012-09-22 05:54:21 +10:00
Russ Cox
19e7a721ba [release-branch.go1] cmd/go: show $GOPATH in 'go env' output
««« backport d6d7de5aa8ed
cmd/go: show $GOPATH in 'go env' output

Also, sort output.

R=golang-dev, patrick, dave, iant
CC=golang-dev, patrick
https://golang.org/cl/6446064

»»»
2012-09-22 05:54:20 +10:00
Brad Fitzpatrick
706832a088 [release-branch.go1] net/http: don't allow zero byte in FileServer paths
««« 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

»»»
2012-09-22 05:54:20 +10:00
Daniel Morsing
5f07ee41ea [release-branch.go1] cmd/gc: point "no new variables" error at right line number.
««« 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

»»»
2012-09-22 05:54:19 +10:00
Russ Cox
2ab2bfaf2f [release-branch.go1] syscall: apply comment from Mikioh
««« 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

»»»
2012-09-22 05:54:19 +10:00
Alexey Borzenkov
56d3f951d1 [release-branch.go1] syscall: workaround accept() bug on Darwin
««« 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

»»»
2012-09-22 05:54:18 +10:00
Benny Siegert
5efc4b03b4 [release-branch.go1] runtime/cgo: fix netbsd build
««« backport 601878acd597
runtime/cgo: fix netbsd build

Copy over freebsd.c to netbsd.c.

Fixes #3823.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6398045

»»»
2012-09-22 05:54:18 +10:00
David Symonds
1489fd1a3e [release-branch.go1] misc/vim: fix :Import insertion heuristic.
««« 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

»»»
2012-09-22 05:54:17 +10:00
Rob Pike
37401b00bf [release-branch.go1] flag: fix bug in handling of booleans on error
««« backport a36c0344826a
flag: fix bug in handling of booleans on error
Fixes #3869.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6448072

»»»
2012-09-22 05:54:17 +10:00
Shenghou Ma
9ff8d11c31 [release-branch.go1] log/syslog: don't append \n if there is one
««« 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

»»»
2012-09-22 05:54:16 +10:00
Alex Brainman
6601acb041 [release-branch.go1] os: move epipecheck from file_posix.go and into file_unix.go to fix windows build
««« 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

»»»
2012-09-22 05:54:16 +10:00
Dmitriy Vyukov
53299c4326 [release-branch.go1] os: fix data race in epipecheck()
««« backport 8b3bf65c620c
os: fix data race in epipecheck()
Fixes #3860.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6443051

»»»
2012-09-22 05:54:15 +10:00
Ian Lance Taylor
8f41e7cd81 [release-branch.go1] runtime: ignore signal 33 == SIGSETXID on GNU/Linux
««« 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

»»»
2012-09-22 05:54:14 +10:00
Robert Griesemer
0db8f6814b [release-branch.go1] go/printer: don't crash if ast.FuncType.Params is nil
««« 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

»»»
2012-09-22 05:54:14 +10:00
Robert Griesemer
c9cf888cd2 [release-branch.go1] A+C: added Andrew Wilkins (individual contributor)
««« backport b22edea8aed4
A+C: added Andrew Wilkins (individual contributor)

R=rsc, minux.ma, iant
CC=golang-dev
https://golang.org/cl/6447050

»»»
2012-09-22 05:54:13 +10:00
Ian Lance Taylor
b222c9e39b [release-branch.go1] cgo: fix declarations in _cgo_export.c
««« 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

»»»
2012-09-22 05:54:13 +10:00
Brad Fitzpatrick
a351c67593 [release-branch.go1] testing: allow concurrent use of T and B
««« 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

»»»
2012-09-22 05:54:12 +10:00
Mikio Hara
6701fa60b6 [release-branch.go1] net: fix comment
««« backport 5a0aafb7fd8d
net: fix comment

RemoteAddr returns not only UDPAddr but IPAddr.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6401054

»»»
2012-09-22 05:54:12 +10:00
Rob Pike
402d6b1f5f [release-branch.go1] text/template: fix bug in map indexing
««« 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

»»»
2012-09-22 05:54:11 +10:00
Rob Pike
74282e400c [release-branch.go1] encoding/gob: revert 6348067, which broke compatibility
««« 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

»»»
2012-09-22 05:54:11 +10:00
Andrew Gerrand
d9c11a7164 [release-branch.go1] doc: add two I/O talks to "Talks" section
««« backport ddaabb722563
doc: add two I/O talks to "Talks" section

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6422056

»»»
2012-09-22 05:54:10 +10:00
Patrick Mylund Nielsen
e40fdffc13 [release-branch.go1] encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.
««« backport 2f39e6389d55
encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6432062

»»»
2012-09-22 05:54:10 +10:00
Mikio Hara
071933faef [release-branch.go1] net: fix file descriptor leak on FileListener, FileConn and FilePacketConn
««« backport aee5a494a65c
net: fix file descriptor leak on FileListener, FileConn and FilePacketConn

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6430062

»»»
2012-09-22 05:54:10 +10:00
Ian Lance Taylor
20ce5bfb6a [release-branch.go1] cgo: add -gccgopkgpath option to match gccgo -fgo-pkgpath
««« backport 06e3a4c30dfb
cgo: add -gccgopkgpath option to match gccgo -fgo-pkgpath

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/6416056

»»»
2012-09-22 05:54:09 +10:00
Mikio Hara
9a0e2e63a3 [release-branch.go1] net: fix typo
««« backport 3019a3e15027
net: fix typo

R=golang-dev, bsiegert, r
CC=golang-dev
https://golang.org/cl/6428050

»»»
2012-09-22 05:54:09 +10:00
Rob Pike
5c47098ec8 [release-branch.go1] sync: mention that WaitGroup.Add panics
««« backport 05f9fa32500a
sync: mention that WaitGroup.Add panics
Fixes #3839.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6428053

»»»
2012-09-22 05:54:08 +10:00
Rémy Oudompheng
d88fcebcd8 [release-branch.go1] testing: fix memory blowup when formatting many lines.
««« backport 5e7fd762f356
testing: fix memory blowup when formatting many lines.

Fixes #3830.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6373047

»»»
2012-09-22 05:54:08 +10:00
Rob Pike
4d5ce93cb9 [release-branch.go1] faq: add status section
««« backport 2819b5a4f07d
faq: add status section
Fixes #3822.

R=golang-dev, r, dsymonds, minux.ma, adg
CC=golang-dev
https://golang.org/cl/6395043

»»»
2012-09-22 05:54:07 +10:00
Adam Langley
920cc5211e [release-branch.go1] A+C: Peter Armitage (individual CLA)
««« backport 0423072b54f2
A+C: Peter Armitage (individual CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6392065

»»»
2012-09-22 05:54:07 +10:00
Nigel Tao
d74aea6fdc [release-branch.go1] compress/flate: fix panic when nlit is out of bounds.
««« backport ecd688de20fb
compress/flate: fix panic when nlit is out of bounds.

Fixes #3815.

R=r
CC=golang-dev
https://golang.org/cl/6352109

»»»
2012-09-22 05:54:06 +10:00