1
0
mirror of https://github.com/golang/go synced 2024-10-03 00:21:22 -06:00
Commit Graph

12388 Commits

Author SHA1 Message Date
Shenghou Ma
2eeab323ad cmd/yacc: don't emit line comment when -l is given
Fixes #5447.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9343045
2013-05-15 12:08:51 +08:00
Alexey Borzenkov
fae362e97e os/user: faster user lookup on Windows
Trying to lookup user's display name with directory services can
take several seconds when user's computer is not in a domain.
As a workaround, check if computer is joined in a domain first,
and don't use directory services if it is not.
Additionally, don't leak tokens in user.Current().
Fixes #5298.

R=golang-dev, bradfitz, alex.brainman, lucio.dere
CC=golang-dev
https://golang.org/cl/8541047
2013-05-15 13:24:54 +10:00
Jonathan Hseu
c691ae6764 testing/quick: fix for aliased types, delete duplicate uint8 test, and fix randFloat64() to give random numbers from (-math.MaxFloat64, math.MaxFloat64).
R=r, agl
CC=agl, bradfitz, golang-dev
https://golang.org/cl/9296046
2013-05-14 17:14:59 -07:00
Carl Shapiro
0e6007e4f9 runtime: enable stack scanning by frames
Update #5134

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9406046
2013-05-14 16:38:12 -07:00
Brad Fitzpatrick
0bbf0ec0ed database/sql: use method values instead of generating closures
Reduces garbage.

R=adg, r
CC=dsymonds, gobot, golang-dev
https://golang.org/cl/9088045
2013-05-14 16:35:31 -07:00
Rémy Oudompheng
6c4943cb51 cmd/gc: fix race instrumentation of selectors T(v).Field
Fixes #5424.

R=golang-dev, daniel.morsing, dvyukov, r
CC=golang-dev
https://golang.org/cl/9033048
2013-05-15 01:25:20 +02:00
Keith Randall
b3946dc119 runtime/bytes: fast Compare for byte arrays and strings.
Uses SSE instructions to process 16 bytes at a time.

fixes #5354

R=bradfitz, google
CC=golang-dev
https://golang.org/cl/8853048
2013-05-14 16:05:51 -07:00
Brad Fitzpatrick
f1583bb956 encoding/json: allocate less in NewEncoder
The *Encoder is almost always garbage. It doesn't need an
encodeState inside of it (and its bytes.Buffer), since it's
only needed locally inside of Encode.

benchmark                 old ns/op    new ns/op    delta
BenchmarkEncoderEncode         2562         2553   -0.35%

benchmark                 old bytes    new bytes    delta
BenchmarkEncoderEncode          283          102  -63.96%

R=r
CC=gobot, golang-dev
https://golang.org/cl/9365044
2013-05-14 15:50:46 -07:00
Rob Pike
d73452b30f cmd/vet: fix for changes to go/types package
Need to use (or stub) exact.Value.

R=gri
CC=golang-dev
https://golang.org/cl/9126043
2013-05-14 15:49:58 -07:00
Alberto García Hierro
d535bc7af3 net/http: Fix basic authentication with empty password
The encoded string must include the : separating the username
        and the password, even when the latter is empty. See
        http://www.ietf.org/rfc/rfc2617.txt for more information.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8475043
2013-05-14 15:33:46 -07:00
Shenghou Ma
9c94580921 archive/tar: skip NUL-filled unused octal fields
Fixes #5290.

R=golang-dev, dave, bradfitz, r
CC=golang-dev
https://golang.org/cl/8763044
2013-05-15 04:40:42 +08:00
Robin Eklind
392cebea5d image: minor update of comments.
R=golang-dev, iant, bradfitz, nigeltao
CC=golang-dev
https://golang.org/cl/9408044
2013-05-14 13:28:16 -07:00
Shenghou Ma
3ac5d54cf9 cmd/gc: improve syntax error for "import testing"
for this program:
package A
import testing

old diagnostics:
pkg.go:2: syntax error: unexpected semicolon or newline, expecting string literal

now:
pkg.go:2: syntax error: missing import path; require quoted string

Fixes #5332.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9393043
2013-05-15 04:19:19 +08:00
Brad Fitzpatrick
2184282308 cmd/api: don't print out except.txt removed features to stdout
It's just noise. They've already been acknowledged in except.txt.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9392047
2013-05-14 09:43:56 -07:00
Brad Fitzpatrick
67acff0b09 go/token: let FileSet.AddFile take a negative base
Negative base now means "automatic". Fixes a higher
level race.

Fixes #5418

R=gri
CC=golang-dev
https://golang.org/cl/9269043
2013-05-14 09:30:13 -07:00
Dmitriy Vyukov
5a7e14c143 runtime/race: improve public documentation
Move the documentation from race.go to doc.go, because
race.go uses +build race, so it's not normally parsed by go doc.
Rephrase the documentation for end users, provide link to race
detector manual.
Fixes #5444.

R=golang-dev, minux.ma, adg, r
CC=golang-dev
https://golang.org/cl/9144050
2013-05-13 10:28:12 +04:00
Ian Lance Taylor
26d95d8027 runtime: fix crash in select
runtime.park() can access freed select descriptor
due to a racing free in another thread.
See the comment for details.

Slightly modified version of dvyukov's CL 9259045.

No test yet.  Before this CL, the test described in issue 5422
would fail about every 40 times for me.  With this CL, I ran
the test 5900 times with no failures.

Fixes #5422.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9311043
2013-05-08 14:58:34 -07:00
Ian Lance Taylor
8a28085a0f cmd/cgo: pass -Wsystem-headers when looking for errors
This works around a bug in GCC 4.8.0.

Fixes #5118.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/9120045
2013-05-08 06:28:33 -07:00
Alex Brainman
e1922febbe net: fix dial race on plan9 and windows
Fixes #5349.

R=golang-dev, lucio.dere, dsymonds, bradfitz, iant, adg, dave, r
CC=golang-dev
https://golang.org/cl/9159043
2013-05-08 16:19:02 +10:00
Brad Fitzpatrick
9e93d5014e api: add go1.1.txt; update cmd/api to use it
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/9250043
2013-05-06 17:25:09 -07:00
Dmitriy Vyukov
f322c78692 runtime: fix crash in badsignal()
The linker can generate split stack prolog when a textflag 7 function
makes an indirect function call.  If it happens, badsignal() crashes
trying to dereference g.
Fixes #5337.

R=bradfitz, dave, adg, iant, r, minux.ma
CC=adonovan, golang-dev
https://golang.org/cl/9226043
2013-05-06 16:15:03 -07:00
Shenghou Ma
b3b1efd882 runtime: reduce max arena size on windows/amd64 to 32 GiB
Update #5236
Update #5402
This CL reduces gofmt's committed memory from 545864 KiB to 139568 KiB.
Note: Go 1.0.3 uses about 70MiB.

R=golang-dev, r, iant, nightlyone
CC=golang-dev
https://golang.org/cl/9245043
2013-05-07 06:53:02 +08:00
Brad Fitzpatrick
e85016f81f database/sql: remove an unused field from Rows
Found while debugging memory usage. Nobody accesses this field
anymore.

R=golang-dev, i.caught.air, adg, r
CC=golang-dev
https://golang.org/cl/9108043
2013-05-06 15:16:47 -07:00
Shenghou Ma
6de184b385 syscall: fix prototype of Fchflags (API change)
API change, but the old API is obviously wrong.

R=golang-dev, iant, r, rsc
CC=golang-dev
https://golang.org/cl/9157044
2013-05-07 05:20:00 +08:00
Jeremiah Harmsen
a228e733b9 go/doc/example: Fix bug causing false negatives for Example playability.
Allows Examples with KeyValue expressions to be playable in godoc.

During the traversal of the abstract syntax tree any KeyValueExpr Key.Name was incorrectly being added as an unresolved identifier.
Since this identifier could not be provided the Example was marked as unplayable.
This updates the AST traversal to skip Keys (but continue traversing the Values).

Example of problematic AST now fixed (see L99 where "UpperBound" was being added as a missing identifier):

 81  .  .  .  .  .  .  .  .  .  Values: []ast.Expr (len = 1) {
 82  .  .  .  .  .  .  .  .  .  .  0: *ast.UnaryExpr {
 83  .  .  .  .  .  .  .  .  .  .  .  OpPos: 12:19
 84  .  .  .  .  .  .  .  .  .  .  .  Op: &
 85  .  .  .  .  .  .  .  .  .  .  .  X: *ast.CompositeLit {
 86  .  .  .  .  .  .  .  .  .  .  .  .  Type: *ast.SelectorExpr {
 87  .  .  .  .  .  .  .  .  .  .  .  .  .  X: *ast.Ident {
 88  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 12:20
 89  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "t_proto"
 90  .  .  .  .  .  .  .  .  .  .  .  .  .  }
 91  .  .  .  .  .  .  .  .  .  .  .  .  .  Sel: *ast.Ident {
 92  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 12:41
 93  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "BConfig"
 94  .  .  .  .  .  .  .  .  .  .  .  .  .  }
 95  .  .  .  .  .  .  .  .  .  .  .  .  }
 96  .  .  .  .  .  .  .  .  .  .  .  .  Lbrace: 12:79
 97  .  .  .  .  .  .  .  .  .  .  .  .  Elts: []ast.Expr (len = 2) {
 98  .  .  .  .  .  .  .  .  .  .  .  .  .  0: *ast.KeyValueExpr {
 99  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Key: *ast.Ident {
100  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:3
101  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "UpperBound"
102  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }
103  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Colon: 13:13
104  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Value: *ast.CallExpr {
105  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Fun: *ast.SelectorExpr {
106  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  X: *ast.Ident {
107  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:15
108  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "proto"
109  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }
110  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Sel: *ast.Ident {
111  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:21
112  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "Float32"
113  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }

R=adg
CC=gobot, golang-dev, gri
https://golang.org/cl/8569045
2013-05-06 10:15:16 -07:00
Brad Fitzpatrick
1294f14f1f image/png: fix error message to not return width twice
Fixes #5413

R=golang-dev, dave, adg
CC=golang-dev
https://golang.org/cl/9153045
2013-05-06 09:59:33 -07:00
Shenghou Ma
a21b36da1c go/build: document GOOS.go also has implicit GOOS build constraint
R=golang-dev, i.caught.air, alexb, r
CC=golang-dev
https://golang.org/cl/9064044
2013-05-05 02:23:19 +08:00
Keith Randall
4ff48c7f45 text/template: comment fix
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/9086043
2013-05-03 14:22:34 -07:00
Shenghou Ma
988236ba86 runtime/cgo: fix build for ARM
TBR=iant
CC=golang-dev
https://golang.org/cl/9048048
2013-05-03 17:15:43 +08:00
Shenghou Ma
e0db7fae87 cmd/ld: add .note.GNU-stack section for external linking
Fixes #5392.

R=iant, r
CC=golang-dev
https://golang.org/cl/9119043
2013-05-03 16:33:21 +08:00
Brad Fitzpatrick
7cc0581f86 regexp: doc fix
This must have been from when "error" was a good variable
name for an "os.Error". But we use "err" these days.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/9132045
2013-05-02 18:59:39 -07:00
Alex Brainman
3a32367040 cmd/ld: fix SDYNIMPORT symbol test
As advised by iant. Fixes windows build.

R=golang-dev, r
CC=golang-dev, iant
https://golang.org/cl/9110044
2013-05-02 13:02:00 +10:00
Rob Pike
d727d147c0 cmd/ld: fix another unsigned value causing bugs on Plan 9
"The usual conversions" bite again.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9103044
2013-05-01 17:00:21 -07:00
David du Colombier
c8942f021e libmach: fix build on Plan 9
Include libc.h before bio.h in 8.c, because bio.h uses
the UTFmax enum, which is declared in libc.h, since
the recent switch to 21-bit runes in Plan 9.

The 5.c and 6.c files already includes libc.h.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9040047
2013-05-01 15:48:13 -07:00
Ian Lance Taylor
83feea5af8 cmd/cgo: correct pragma name in comment
R=rsc, alexb, minux.ma, bradfitz, i.caught.air
CC=golang-dev
https://golang.org/cl/9082043
2013-05-01 14:31:42 -07:00
Ian Lance Taylor
9de38d6788 runtime/cgo: export symbols in both internal and external link mode
R=rsc, r
CC=golang-dev
https://golang.org/cl/9060045
2013-05-01 14:30:51 -07:00
Ian Lance Taylor
a555758909 cmd/ld: fix syms that are both cgo_import_static & cgo_import_dynamic
This is needed for SWIG when linking in internal mode.  In
internal mode if a symbol was cgo_import_static we used to
forget that it was also cgo_import_dynamic.

R=rsc, r
CC=golang-dev
https://golang.org/cl/9080043
2013-05-01 14:30:19 -07:00
Alex Brainman
ca6b1f3eeb net: do not call syscall.Bind twice on windows
Fixes #5355.

R=golang-dev, mikioh.mikioh, bradfitz, r
CC=golang-dev
https://golang.org/cl/8966046
2013-04-30 17:47:39 -07:00
Rob Pike
2a1ca145cf cmd/ld: when linking externally, only generate dwarf info for ELF
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9025047
2013-04-30 14:22:28 -07:00
Russ Cox
ed9644fc39 cmd/go: undo CL 8119049
Manual undo due to later changes in doc/go1.1.html; cmd/go/test.bash still passes.

Rationale, from CL 8119049 review log:

This makes the 'go run' command different from every other command.
For example, 'go test' does not mean 'go test *.go'.

If we were going to handle the no arguments case in 'go run', I would hope that
it would scan the current directory to find a package just like 'go build' or
'go test' would, and then it would require that package to be 'package main',
and then it would run that package. This would make it match 'go test' and 'go
build' and 'go install' and so on. It would mean that if you are working on a
command in a directory that is 'go install'able, then 'go run' will run the
binary for you. The current CL does not accomplish that when build constraints
or file name constraints are involved.

For example, if I am working on a program like:

$ ls
main.go
main_386.s
main_arm.s
main_amd64.s
$

Then 'go run' will fail here because the .s files are ignored.

If instead I am working on a program like:

$ ls
main.go
main_386.go
main_arm.go
main_amd64.go
$

then 'go run' will fail because too many files are included.

I would like to see this command implemented so that it is compatible with the
other go subcommands. Since it is too late to do that for Go 1.1, I would like
to see this CL reverted, to preserve the option to do it better later.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8797049
2013-04-30 17:04:58 -04:00
Ian Lance Taylor
825b1e1591 cmd/ld: emit relocs for DWARF info when doing an external link
I would like opinions on whether this is a good idea for 1.1.
On the one hand it's a moderately important issue.  On the
other hand this introduces at least the possibility of
external linker errors due to the additional relocations and
it may be better to wait.

I'm fairly confident that the behaviour is unchanged when not
using an external linker.

Update #5221

This CL is tested lightly on 386 and amd64 and fixes the cases
I tested.  I have not tested it on Darwin or Windows.

R=golang-dev, dave, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/8858047
2013-04-30 14:01:05 -07:00
Rob Pike
b461c94cfa os/exec: disable TestExtraFilesFDShuffle
It's too hard to make portable just now.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9057043
2013-04-30 13:17:37 -07:00
Cosmos Nicolaou
b493f0a868 syscall: fix a bug in the shuffling of file descriptors in StartProcess on Linux.
R=iant, iant, r, bradfitz
CC=golang-dev
https://golang.org/cl/8334044
2013-04-30 11:52:23 -07:00
Rob Pike
479b1241b5 syscall: fix exec_bsd.go to accompany exec_linux.go changes
exec_plan9.go too.
Those are in CL 8334044

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9055043
2013-04-30 11:52:15 -07:00
Rob Pike
5c0d782ab8 cmd/ld: another attempt at the relocation overflow fix
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9036046
2013-04-30 09:49:36 -07:00
Rob Pike
700a126c64 cmd/ld: fix check for address wrap in relocation
PC-relative needs a signed offset; others need unsigned.
Also fix signedness of 32-bit relocation on Windows.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9039045
2013-04-30 09:10:10 -07:00
Rob Pike
396d3af8d0 cmd/ld: disable relocation range check so build can go green while we debug the issue.
R=golang-dev, dsymonds, dave
CC=golang-dev
https://golang.org/cl/9038043
2013-04-30 00:19:21 -07:00
Rob Pike
4dcb13bb44 cmd/gc: fix some overflows in the compiler
Some 64-bit fields were run through 32-bit words, some counts were
not checked for overflow, and relocations must fit in 32 bits.
Tests to follow.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9033043
2013-04-29 22:44:40 -07:00
Rob Pike
e4c4edf681 cmd/ld: fix some 64-bit issues
A few places in the linker pushed 64-bit values through 32-bit holes,
including in relocation.
Clean them up, and check for a few other overflows as well.
Tests to follow.

R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/9032043
2013-04-29 22:44:20 -07:00
Shenghou Ma
5c20a4f260 encoding/json: document that marshaling invalid utf-8 sequence will return error
Also added docs for InvalidUTF8Error.
Fixes #5360.

R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/8926046
2013-04-30 11:21:48 +08:00