1
0
mirror of https://github.com/golang/go synced 2024-09-24 23:20:12 -06:00
Commit Graph

11563 Commits

Author SHA1 Message Date
Andrew Gerrand
e10150f96d codereview: don't check default paths when codereview disabled
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5622043
2012-02-02 14:25:13 -05:00
Damian Gryski
8e765da941 runtime: add runtime.cputicks() and seed fastrand with it
This patch adds a function to get the current cpu ticks.  This is
deemed to be 'sufficiently random' to use to seed fastrand to mitigate
the algorithmic complexity attacks on the hash table implementation.

On AMD64 we use the RDTSC instruction.  For 386, this instruction,
while valid, is not recognized by 8a so I've inserted the opcode by
hand.  For ARM, this routine is currently stubbed to return a constant
0 value.

Future work: update 8a to recognize RDTSC.

Fixes #2630.

R=rsc
CC=golang-dev
https://golang.org/cl/5606048
2012-02-02 14:09:27 -05:00
Wei Guangjing
16ce2f9369 os: Process.handle use syscall.Handle
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5605050
2012-02-02 14:08:48 -05:00
Ian Lance Taylor
cdabb3d315 test: add import test that caused an incorrect gccgo error
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5622048
2012-02-02 11:04:09 -08:00
Marcel van Lohuizen
8ba20dbdb5 exp/norm: a few minor changes in prepration for a table format change:
- Unified bounary conditions for NFC and NFD and removed some indirections.
   This enforces boundaries at the character level, which is typically what
   the user expects. (NFD allows a boundary between 'a' and '`', for example,
   which may give unexpected results for collation.  The current implementation
   is already stricter than the standard, so nothing much changes.  This change
   just formalizes it.
 - Moved methods of qcflags to runeInfo.
 - Swapped YesC and YesMaybe bits in qcFlags. This is to aid future changes.
 - runeInfo return values use named fields in preperation for struct change.
 - Replaced some left-over uint32s with rune.

R=r
CC=golang-dev
https://golang.org/cl/5607050
2012-02-02 13:55:53 +01:00
Marcel van Lohuizen
d673c95d6c exp/norm: Added some benchmarks for form-specific performance measurements.
R=r
CC=golang-dev
https://golang.org/cl/5605051
2012-02-02 13:19:12 +01:00
Nigel Tao
df7f34dd2b vet: fix comment typo.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5620049
2012-02-02 17:53:28 +11:00
Jongmin Kim
a98faa9b6f gophertool: fix link to the build status dashboard
R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/5606050
2012-02-01 20:53:31 -08:00
Andrew Gerrand
40b7e814e5 godoc: update metadata in appinit.go
R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/5619050
2012-02-02 15:18:33 +11:00
Ian Lance Taylor
2b8d5be55f os/exec: make sure file is not closed early in leaked fd test
Without this change, fd3 can be collected by the garbage
collector and finalized, which causes the file descriptor to
be closed, which causes the call to os.Open to return 3 rather
than the expected descriptor number.

R=golang-dev, gri, bradfitz, bradfitz, iant
CC=golang-dev
https://golang.org/cl/5607056
2012-02-01 16:37:02 -08:00
Robert Griesemer
f3f5239d1e all packages: fix various typos
Detected semi-automatically. There are probably more.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620046
2012-02-01 16:19:36 -08:00
Russ Cox
5cc07af675 syscall: fix build directive in types_linux.go
The rule is that build directives can be preceded only
by blank lines and other line comments, not /* */ comments.

R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5619045
2012-02-01 18:25:51 -05:00
Russ Cox
b53ce1e662 lib9: make safe for automatic builds
R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5615046
2012-02-01 18:25:40 -05:00
Ian Lance Taylor
3692726f32 test: test append with two different named types with same element type
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5615045
2012-02-01 15:24:15 -08:00
Wei Guangjing
4ea5d62e5a os: file windows use syscall.InvalidHandle instead of -1.
R=golang-dev, adg, alex.brainman
CC=golang-dev
https://golang.org/cl/5602050
2012-02-02 10:17:52 +11:00
Brad Fitzpatrick
b2935330b0 net/http/httputil: fix race in DumpRequestOut
Fixes #2715

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5614043
2012-02-01 15:10:14 -08:00
Andrew Gerrand
548206e869 go/printer: remove package comment from testdata/parser.go
This prevents an incorrect summary line from appearing in the godoc
package list.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5607059
2012-02-02 09:28:11 +11:00
David Symonds
b68d947b91 os/signal: move to exp/signal.
Fixes #2816.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5609048
2012-02-02 09:08:50 +11:00
Andrew Gerrand
55779917f3 go/build: put a space between 'generated by make' and package statement
This prevents the message from showing up in godoc.

R=rsc
CC=golang-dev
https://golang.org/cl/5610046
2012-02-02 08:52:22 +11:00
Robert Griesemer
71c19b610f mat/big: add raw access to Int bits
This is a minimal API extension, it makes it possible
to implement missing Int functionality externally w/o
compromising efficiency. It is the hope that this will
reduce the number of feature requests going directly
into the big package.

Also: Fixed some naming inconsistencies: The receiver
is only called z when it is also the result.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/5607055
2012-02-01 11:43:40 -08:00
Gustavo Niemeyer
9fb24b9448 cmd/go: fix including of _cgo_export.h
This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.

This was previously applied by CL 5600043, and apparently
removed by mistake on CL 5598045.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610054
2012-02-01 16:07:32 -02:00
Ian Lance Taylor
4e77e0f294 test: test that x := <-c accepts a general expression
The gccgo compiler used to fail to parse this.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5610051
2012-02-01 07:31:00 -08:00
Luuk van Dijk
8dd3de4d4b pkg/math: undo manual inlining of IsInf and IsNaN
R=rsc
CC=golang-dev
https://golang.org/cl/5484076
2012-02-01 16:08:31 +01:00
Sameer Ajmani
702151a200 godoc: fix redirect loop for URL "/".
R=golang-dev, bradfitz, rsc, adg
CC=golang-dev
https://golang.org/cl/5606045
2012-02-01 09:43:22 -05:00
Anthony Martin
e280035fc1 gc, cc: avoid using the wrong library when building the compilers
This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.

R=rsc
CC=golang-dev
https://golang.org/cl/5599053
2012-02-01 04:14:37 -08:00
David Symonds
2f2b6e55ef encoding/base64: ignore new line characters during decode.
Fixes #2541.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610045
2012-02-01 19:13:38 +11:00
Mikio Hara
804f1882c5 net, syscall: add IPv4 multicast helpers for windows
Also re-enable simple IPv4 multicast testing on windows.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5605048
2012-02-01 14:14:04 +09:00
Andrew Gerrand
63f68a2eda go/build: update syslist.go package comment
It's no longer generated by make.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5602047
2012-02-01 15:12:24 +11:00
Anthony Martin
6273d6e713 build: move the "-c" flag into HOST_CFLAGS
On Plan 9 this flag is used to discover
constant expressions in "if" statements.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5601060
2012-01-31 19:31:30 -08:00
Anthony Martin
8039683cef gc: use octal escapes in mkopnames
Plan 9's tr(1) doesn't accept the C-style escapes
for tab and newline characters.  I was going to use
the \xFF hexadecimal escapes but GNU tr(1) doesn't
accept those.  It seems octal is the least common
denominator.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5576079
2012-01-31 18:15:42 -08:00
Anthony Martin
cc777490fb build: add include files for Plan 9
Previously, I had made available a tarball of
the modified system headers that were necessary
to build on Plan 9 but that was only a stopgap.
I think this method is much better since no
files outside of $GOROOT will have to be added
or modified during the build process.

Also, this is just the first step. I'll change
the build to reference these files in another CL
(that also contains a few more Makefile changes).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5552056
2012-01-31 18:14:44 -08:00
Anthony Martin
1583931bcf syscall: cache environment variables on Plan 9.
This can drastically reduce the number of system
calls made by programs that repeatedly query the
environment.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5599054
2012-01-31 18:14:02 -08:00
Anthony Martin
82555d7b40 libmach: add stubs for Plan 9
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5576080
2012-01-31 18:13:17 -08:00
Alex Brainman
238af7700e net: fix windows build
Ignore result of setting SO_BROADCAST.

Disable TestSimpleListenMulticastUDP as
setIPv4MulticastInterface is not implemented.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5610044
2012-02-01 12:13:46 +11:00
Ian Lance Taylor
f6f83e4938 test: add test which crashed gccgo compiler
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5605046
2012-01-31 16:19:25 -08:00
Russ Cox
42526e2187 cmd/go: improvements
Print all the syntax errors.  Fixes issue 2811.

Change Windows binary removal strategy.
This should keep the temporary files closer to
the binaries they are for, which will make it
more likely that the rename is not cross-device
and also make it easier to clean them up.
Fixes #2604 (as much as we can).

The standard build does not use the go command
to install the go command anymore, so issue 2604
is less of a concern than it originally was.
(It uses the go_bootstrap command to install
the go command.)

Buffer 'go list' output.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5604048
2012-01-31 18:44:20 -05:00
Robert Griesemer
f7d473dd33 go/doc: added error, rune to list of predeclared types
Don't throw away factory functions returning error or rune.

Fixes #2820.

R=rsc
CC=golang-dev
https://golang.org/cl/5604046
2012-01-31 15:41:25 -08:00
Russ Cox
d7c04517a0 fmt: fix caching bug in Scan
Black box test is too time-consuming, as the bug
does not appear until Scan has processed 2 GB of
input in total across multiple calls, so no test.

Thanks to Frederick Mayle for the diagnosis and fix.

Fixes #2809.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5611043
2012-01-31 18:38:33 -05:00
Brad Fitzpatrick
d3285f2a79 net: remove types InvalidConnError and UnknownSocketError
Both are unused and undocumented.

InvalidConnError is also non-idiomatic: a FooError type can
typically describe something, else it would be an ErrFoo
variable.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5609045
2012-01-31 15:04:42 -08:00
Russ Cox
0f1056667f cmd/go: improvements
Do not treat $GOROOT/src/pkg, $GOROOT/src/cmd,
$GOPATH/src as package directories (only subdirectories
of those can be package directories).  Fixes issue 2602.

Accept additional compiler and linker arguments during
cgo from $CGO_CFLAGS and $CGO_LDFLAGS, as the
Makefiles used to do.

Show failed pkg-config output.  Fixes issue 2785.

Use different (perhaps better) git commands.  Fixes issue 2109.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5605045
2012-01-31 17:40:36 -05:00
Rémy Oudompheng
e818536500 go: record location of failed imports for error reporting.
Fixes #2664.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5593047
2012-01-31 23:37:01 +01:00
Russ Cox
33f3afa7af gc: diagnose \ in import path
R=ken2
CC=golang-dev
https://golang.org/cl/5609044
2012-01-31 17:29:59 -05:00
Russ Cox
6aa6fdcf71 build: remove ./ from buildscripts
Fixes #2753.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5609043
2012-01-31 16:53:43 -05:00
Brad Fitzpatrick
549ca930a0 net: move DNSConfigError to a portable file
The type being unavailable on Windows was the only API
signature difference in the net package.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5608043
2012-01-31 13:01:34 -08:00
Russ Cox
64a73b0355 cmd/go: improvements
Print build errors to stderr during 'go run'.
Stream test output during 'go test' (no args).  Fixes issue 2731.
Add go test -i to install test dependencies.  Fixes issue 2685.
Fix data race in exitStatus.  Fixes issue 2709.
Fix tool paths.  Fixes issue 2817.

R=golang-dev, bradfitz, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/5591045
2012-01-31 15:08:20 -05:00
Rémy Oudompheng
d7172084d0 cmd/go: fix handling of gccgo standard library.
The previous logic was mainly non-working. It only needs to
ensure that the go tool doesn't try to build the standard
library with gccgo.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5580051
2012-01-31 19:41:38 +01:00
Robert Griesemer
3c6bebf5a7 go/doc: enable AllMethods flag (and fix logic)
- enable AllMethods flag (default: not set)
- fix logic determining which methods to show
- added respective test case in testdata/e.go for AllMethods = false
- added test case set for AllMethods = true

The critical changes/files to look at are:
- testdata/e{0,1,2}.golden: T4.M should only show up as method of T5 in e2.golden
- reader.go: always include top-level methods, and negate former logic for embedded methods
  (rewrote as a switch for better comprehensability)

Fixes #2791.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5576057
2012-01-31 09:48:10 -08:00
Brad Fitzpatrick
c0ecfb072b net/http: close client fd sooner on response read error
This fixes some test noise in TestStressSurpriseServerCloses when
ulimit -n something low, like 256 on a Mac.

Previously, when the server closed on us and we were expecting more
responses (like we are in that test), we'd read an "Unexpected EOF"
and just forget about the client's net.Conn.  Now it's closed,
rather than waiting on the finalizer to release the fd.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5602043
2012-01-31 09:45:13 -08:00
Mikio Hara
847197d339 net: disable normal multicast testing on linux/arm
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5603043
2012-02-01 02:42:56 +09:00
Adam Langley
2cc3351131 crypto/elliptic: p224Contract could produce a non-minimal representation.
I missed an overflow in contract because I suspected that the prime
elimination would take care of it. It didn't, and I forgot to get back
to the overflow. Because of this, p224Contract may have produced a
non-minimal representation, causing flakey failures ~0.02% of the
time.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5592045
2012-01-31 12:27:42 -05:00