]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agotest: add a test that gccgo failed to compile
Ian Lance Taylor [Wed, 18 Sep 2013 22:47:50 +0000 (15:47 -0700)]
test: add a test that gccgo failed to compile

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

11 years agotest: disable failing tests under ssa/interp.
Alan Donovan [Wed, 18 Sep 2013 18:44:57 +0000 (14:44 -0400)]
test: disable failing tests under ssa/interp.

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

11 years agotest: add a test that crashed gccgo
Ian Lance Taylor [Wed, 18 Sep 2013 01:06:58 +0000 (18:06 -0700)]
test: add a test that crashed gccgo

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

11 years agonet/http/cgi: use 'https://' for urls if HTTPS is set.
Thomas Habets [Wed, 18 Sep 2013 00:48:28 +0000 (10:48 +1000)]
net/http/cgi: use 'https://' for urls if HTTPS is set.

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

11 years agoC: add Thomas Habets (Google CLA)
Andrew Gerrand [Wed, 18 Sep 2013 00:48:11 +0000 (10:48 +1000)]
C: add Thomas Habets (Google CLA)

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

11 years agocmd/gc: fix set but not used error
Dave Cheney [Wed, 18 Sep 2013 00:15:52 +0000 (10:15 +1000)]
cmd/gc: fix set but not used error

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

11 years agocmd/go: add basic docs on calling between Go and C/C++
Ian Lance Taylor [Wed, 18 Sep 2013 00:10:48 +0000 (17:10 -0700)]
cmd/go: add basic docs on calling between Go and C/C++

This is a framework for docs on the subject more than it is
actual docs.

The section header in go/doc.go just says "C", not "C/C++,"
because otherwise godoc doesn't recognize the line as a
section header.

Fixes #5473.

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

11 years agotest: avoid future 'declared and not used' error
Robert Griesemer [Tue, 17 Sep 2013 22:24:54 +0000 (15:24 -0700)]
test: avoid future 'declared and not used' error

See also issue 6414.

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

11 years agoencoding/xml: remove dead code
Robert Griesemer [Tue, 17 Sep 2013 22:24:40 +0000 (15:24 -0700)]
encoding/xml: remove dead code

Avoid future 'declared and not used error'.
See also issue 6414.

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

11 years agoreflect: test method calls on pointers to pointers
Ian Lance Taylor [Tue, 17 Sep 2013 22:22:42 +0000 (15:22 -0700)]
reflect: test method calls on pointers to pointers

Gccgo got this wrong, and evidently nothing else tests it.

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

11 years agocmd/gc: eliminate redundant &x.Field nil checks
Russ Cox [Tue, 17 Sep 2013 20:54:22 +0000 (16:54 -0400)]
cmd/gc: eliminate redundant &x.Field nil checks

This eliminates ~75% of the nil checks being emitted,
on all architectures. We can do better, but we need
a bit more general support from the compiler, and
I don't want to do that so close to Go 1.2.
What's here is simple but effective and safe.

A few small code generation cleanups were required
to make the analysis consistent on all systems about
which nil checks are omitted, at least in the test.

Fixes #6019.

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

11 years agocrypto/tls: don't select ECDSA ciphersuites with only an RSA certificate.
Adam Langley [Tue, 17 Sep 2013 17:30:36 +0000 (13:30 -0400)]
crypto/tls: don't select ECDSA ciphersuites with only an RSA certificate.

47ec7a68b1a2 added support for ECDSA ciphersuites but didn't alter the
cipher suite selection to take that into account. Thus Go servers could
try and select an ECDSA cipher suite while only having an RSA
certificate, leading to connection failures.

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

11 years agocmd/cgo: rearrange and update documentation
Ian Lance Taylor [Tue, 17 Sep 2013 14:11:40 +0000 (07:11 -0700)]
cmd/cgo: rearrange and update documentation

In particular document that the Go tool will look for certain
file extensions and compile with them with either the C or the
C++ compiler.

Fixes #6393.

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

11 years agotext/template/parse, html/template: copy Tree.text during html template clone
Josh Bleecher Snyder [Tue, 17 Sep 2013 04:19:44 +0000 (14:19 +1000)]
text/template/parse, html/template: copy Tree.text during html template clone

The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980
is that parse's Tree.Text wasn't being copied during the clone.

Fix this by adding and using a Copy method for parse.Tree.

Fixes #5980.

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

11 years agocmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings
Dave Cheney [Tue, 17 Sep 2013 03:43:27 +0000 (13:43 +1000)]
cmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings

Update #5764

Like Tribbles, the more you kill, the more spring up in their place.

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

11 years agoruntime: export PCDATA value reader
Carl Shapiro [Tue, 17 Sep 2013 02:03:19 +0000 (19:03 -0700)]
runtime: export PCDATA value reader

This interface is required to use the PCDATA interface
implemented in Go 1.2.  While initially entirely private, the
FUNCDATA side of the interface has been made public.  This
change completes the FUNCDATA/PCDATA interface.

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

11 years agocmd/gc, runtime: inline append in frontend.
Rémy Oudompheng [Tue, 17 Sep 2013 00:31:21 +0000 (20:31 -0400)]
cmd/gc, runtime: inline append in frontend.

A new transformation during walk turns append calls
into a combination of growslice and memmove.

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     141          141   +0.00%
BenchmarkAppend1Byte                 18           11  -39.56%
BenchmarkAppend4Bytes                19           10  -42.63%
BenchmarkAppend7Bytes                18           10  -42.16%
BenchmarkAppend8Bytes                18           10  -40.44%
BenchmarkAppend15Bytes               19           11  -41.67%
BenchmarkAppend16Bytes               19           11  -41.97%
BenchmarkAppend32Bytes               23           14  -38.82%
BenchmarkAppendStr1Byte              14           10  -23.78%
BenchmarkAppendStr4Bytes             14           11  -21.13%
BenchmarkAppendStr8Bytes             14           10  -25.17%
BenchmarkAppendStr16Bytes            19           11  -41.45%
BenchmarkAppendStr32Bytes            18           14  -19.44%
BenchmarkAppendSpecialCase           62           63   +1.77%

R=golang-dev, khr, cshapiro, rsc, dave
CC=golang-dev
https://golang.org/cl/12815046

11 years agocmd/nm: make -S listing a bit more accurate
Russ Cox [Tue, 17 Sep 2013 00:27:57 +0000 (20:27 -0400)]
cmd/nm: make -S listing a bit more accurate

Hide container symbols like text and etext so that
the individual pieces inside are shown instead.
For example, if text and main.init have the same
address, it was a toss-up which name was printed.

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

11 years agobuild: disable precise collection of stack frames
Russ Cox [Tue, 17 Sep 2013 00:26:10 +0000 (20:26 -0400)]
build: disable precise collection of stack frames

The code for call site-specific pointer bitmaps was not ready in time,
but the zeroing required without it is too expensive to use by default.
We will have to wait for precise collection of stack frames until Go 1.3.

The precise collection can be re-enabled by

        GOEXPERIMENT=precisestack ./all.bash

but that will not be the default for a Go 1.2 build.

Fixes #6087.

R=golang-dev, jeremyjackins, dan.kortschak, r
CC=golang-dev
https://golang.org/cl/13677045

11 years agoeffective_go: add a discussion of labeled break and continue
Rob Pike [Mon, 16 Sep 2013 21:41:45 +0000 (07:41 +1000)]
effective_go: add a discussion of labeled break and continue
Fixes #5725.

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

11 years agospec: add example for continue to label
Rob Pike [Mon, 16 Sep 2013 21:41:11 +0000 (07:41 +1000)]
spec: add example for continue to label
Make the break example slightly more interesting
Update #5725
Effective Go will be updated in a separate CL.

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

11 years agocrypto/tls: fix TLS 1.2 client certificates.
Adam Langley [Mon, 16 Sep 2013 20:39:42 +0000 (16:39 -0400)]
crypto/tls: fix TLS 1.2 client certificates.

With TLS 1.2, when sending client certificates the code was omitting
the new (in TLS 1.2) signature and hash fields.

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

11 years agocmd/cgo: remove inaccurate comment
Ian Lance Taylor [Mon, 16 Sep 2013 20:19:32 +0000 (13:19 -0700)]
cmd/cgo: remove inaccurate comment

All these features have in fact been implemented.

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

11 years agocmd/gc: do not report fields when looking for methods
Russ Cox [Mon, 16 Sep 2013 19:55:16 +0000 (15:55 -0400)]
cmd/gc: do not report fields when looking for methods

Fixes #6395.

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

11 years agoruntime: fix uint64 division on 386
Russ Cox [Mon, 16 Sep 2013 19:11:32 +0000 (15:11 -0400)]
runtime: fix uint64 division on 386

The uint64 divide function calls _mul64x32 to do a 64x32-bit multiply
and then compares the result against the 64-bit numerator.
If the result is bigger than the numerator, must use the slow path.

Unfortunately, the 64x32 produces a 96-bit product, and only the
low 64 bits were being used in the comparison. Return all 96 bits,
the bottom 64 via the original uint64* pointer, and the top 32
as the function's return value.

Fixes 386 build (broken by ARM division tests).

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

11 years agocmd/gc: fix divide by zero error in compiler
Russ Cox [Mon, 16 Sep 2013 18:22:37 +0000 (14:22 -0400)]
cmd/gc: fix divide by zero error in compiler

Fixes #6399.

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

11 years agoruntime: fix freebsd build
Russ Cox [Mon, 16 Sep 2013 18:22:24 +0000 (14:22 -0400)]
runtime: fix freebsd build

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13720044

11 years agocmd/cgo: fix build (missing file from earlier CL)
Russ Cox [Mon, 16 Sep 2013 18:21:54 +0000 (14:21 -0400)]
cmd/cgo: fix build (missing file from earlier CL)

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13700045

11 years agonet: make all.bat run for ordinary Windows users
Russ Cox [Mon, 16 Sep 2013 18:05:06 +0000 (14:05 -0400)]
net: make all.bat run for ordinary Windows users

This CL is required for all.bat to work out of the box on
my Windows 8 laptop.

These tests either require the firewall to be turned off
or require the user to be in the Administrators group.
I don't know which.

Alex may follow up with a refinement of the test to
allow them to run if the user is in the Administrators
group.

Fixes #6392.

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

11 years agocmd/cgo: allow C.malloc(0) always
Russ Cox [Mon, 16 Sep 2013 18:04:55 +0000 (14:04 -0400)]
cmd/cgo: allow C.malloc(0) always

Because we can, and because it otherwise might crash
the program if we think we're out of memory.

Fixes #6390.

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

11 years agoruntime: make ARM integer div-by-zero traceback-friendly
Russ Cox [Mon, 16 Sep 2013 18:04:45 +0000 (14:04 -0400)]
runtime: make ARM integer div-by-zero traceback-friendly

The implementation of division in the 5 toolchain is a bit too magical.
Hide the magic from the traceback routines.

Also add a test for the results of the software divide routine.

Fixes #5805.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13239052

11 years agoruntime, syscall: work around FreeBSD/amd64 kernel bug
Russ Cox [Mon, 16 Sep 2013 18:04:32 +0000 (14:04 -0400)]
runtime, syscall: work around FreeBSD/amd64 kernel bug

The kernel implementation of the fast system call path,
the one invoked by the SYSCALL instruction, is broken for
restarting system calls. A C program demonstrating this is below.

Change the system calls to use INT $0x80 instead, because
that (perhaps slightly slower) system call path actually works.

I filed http://www.freebsd.org/cgi/query-pr.cgi?pr=182161.

The C program demonstrating that it is FreeBSD's fault is below.
It reports the same "Bad address" failures from wait.

#include <sys/time.h>
#include <sys/signal.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static void handler(int);
static void* looper(void*);

int
main(void)
{
        int i;
        struct sigaction sa;
        pthread_cond_t cond;
        pthread_mutex_t mu;

        memset(&sa, 0, sizeof sa);
        sa.sa_handler = handler;
        sa.sa_flags = SA_RESTART;
        memset(&sa.sa_mask, 0xff, sizeof sa.sa_mask);
        sigaction(SIGCHLD, &sa, 0);

        for(i=0; i<2; i++)
                pthread_create(0, 0, looper, 0);

        pthread_mutex_init(&mu, 0);
        pthread_mutex_lock(&mu);
        pthread_cond_init(&cond, 0);
        for(;;)
                pthread_cond_wait(&cond, &mu);

        return 0;
}

static void
handler(int sig)
{
}

int
mywait4(int pid, int *stat, int options, struct rusage *rusage)
{
        int result;

        asm("movq %%rcx, %%r10; syscall"
                : "=a" (result)
                : "a" (7),
                  "D" (pid),
                  "S" (stat),
                  "d" (options),
                  "c" (rusage));
}

static void*
looper(void *v)
{
        int pid, stat, out;
        struct rusage rusage;

        for(;;) {
                if((pid = fork()) == 0)
                        _exit(0);
                out = mywait4(pid, &stat, 0, &rusage);
                if(out != pid) {
                        printf("wait4 returned %d\n", out);
                }
        }
}

Fixes #6372.

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

11 years agocmd/go: document that "main" is a reserved import path
Rob Pike [Mon, 16 Sep 2013 12:53:12 +0000 (22:53 +1000)]
cmd/go: document that "main" is a reserved import path
Fixes #6312.

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

11 years agonet/rpc: log I/O and internal errors only if debugLog is set.
Han-Wen Nienhuys [Mon, 16 Sep 2013 06:29:04 +0000 (16:29 +1000)]
net/rpc: log I/O and internal errors only if debugLog is set.

Fixes #6367.

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

11 years agodoc/go1.2.html: add a "New packages" section similar to
Nigel Tao [Mon, 16 Sep 2013 06:26:07 +0000 (16:26 +1000)]
doc/go1.2.html: add a "New packages" section similar to
http://golang.org/doc/go1.1#new_packages

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

11 years agocmd/nm: put the -S flag in the usage message
Rob Pike [Mon, 16 Sep 2013 06:13:27 +0000 (16:13 +1000)]
cmd/nm: put the -S flag in the usage message
The -S flag reports symbol size, but is missing from the usage message.

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

11 years agodoc: re-organize golang.org site content
Andrew Gerrand [Mon, 16 Sep 2013 05:47:13 +0000 (15:47 +1000)]
doc: re-organize golang.org site content

Remove "References" section.
Remove most articles and redirect to blog.golang.org.
Move /ref/spec and /ref/mem to /doc/spec and /doc/mem.
Remove duplicate links from the remaining
"Documents", "The Project", and "Help" pages.
Defer to the wiki for more links and community content.
Update command reference and mention cover tool.
Add "Pop-out" text to the front page.
Pick one of four videos at random to feature on the front page.

Fixes #2547.
Fixes #5561.
Fixes #6321.

R=r, dominik.honnef
CC=golang-dev
https://golang.org/cl/13724043

11 years agodoc/go1.2.html: compiler changes
Rob Pike [Mon, 16 Sep 2013 03:03:00 +0000 (13:03 +1000)]
doc/go1.2.html: compiler changes
Document the semantic changes within the gc toolchain.

Also delete the mention of unbalanced right delims in template
That change was rolled back.

Absent typos, things we've forgotten, and new things that happen,
the release notes are ready.

R=golang-dev, adg, dominik.honnef
CC=golang-dev
https://golang.org/cl/13368052

11 years agosort: move example to package level and simplify further
Andrew Gerrand [Mon, 16 Sep 2013 03:02:01 +0000 (13:02 +1000)]
sort: move example to package level and simplify further

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

11 years agodoc: add uninstallation instructions
Andrew Gerrand [Mon, 16 Sep 2013 01:20:07 +0000 (11:20 +1000)]
doc: add uninstallation instructions

Fixes #5821.

R=golang-dev, kamil.kisiel
CC=golang-dev
https://golang.org/cl/13720043

11 years agocmd/gofmt: document -s transformations
Andrew Gerrand [Mon, 16 Sep 2013 01:19:39 +0000 (11:19 +1000)]
cmd/gofmt: document -s transformations

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

11 years agodoc/go1.2.html: net/http, encoding, performance, library changes
Rob Pike [Mon, 16 Sep 2013 00:28:53 +0000 (10:28 +1000)]
doc/go1.2.html: net/http, encoding, performance, library changes
Everything is done except compiler changes and additional platforms, if any.

R=golang-dev, dominik.honnef, adg
CC=golang-dev
https://golang.org/cl/13484045

11 years agoencoding/gob: ignore chan and func fields of structures
Rob Pike [Mon, 16 Sep 2013 00:26:23 +0000 (10:26 +1000)]
encoding/gob: ignore chan and func fields of structures

Previously, fields of type chan or func caused an error.
Now we just treat them like unexported fields and ignore them.
This makes it easier to guarantee long-term compatibilty since
a substructure from another package cannot break gob
encoding by adding a func or chan field.

Fixes #6071

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

11 years agoruntime: fix CPU profiling on Windows
Russ Cox [Sun, 15 Sep 2013 16:05:24 +0000 (12:05 -0400)]
runtime: fix CPU profiling on Windows

The test 'gp == m->curg' is not valid on Windows,
because the goroutine being profiled is not from the
current m.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13718043

11 years agogo/build: add ctxt.MatchFile
Russ Cox [Sun, 15 Sep 2013 15:29:47 +0000 (11:29 -0400)]
go/build: add ctxt.MatchFile

Fixes #6369.

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

11 years agoencoding/xml: document behavior for undefined name space prefixes
Russ Cox [Sun, 15 Sep 2013 15:29:06 +0000 (11:29 -0400)]
encoding/xml: document behavior for undefined name space prefixes

Fixes #5626.

R=golang-dev, dominik.honnef
CC=golang-dev
https://golang.org/cl/13702043

11 years agofmt: %b for complex64 and complex128
Rob Pike [Sun, 15 Sep 2013 00:45:36 +0000 (10:45 +1000)]
fmt: %b for complex64 and complex128
Just an oversight they were missing.
Fixes #6387

R=golang-dev, dominik.honnef, rsc
CC=golang-dev
https://golang.org/cl/13715043

11 years agocmd/gc: don't generate algs for internal map types.
Rémy Oudompheng [Sat, 14 Sep 2013 07:30:36 +0000 (09:30 +0200)]
cmd/gc: don't generate algs for internal map types.

Fake types describing the internal structure of hashmaps are
generated for use by precise GC.

Generating hash and eq functions for these fake types slows down
the build and wastes space: the go tool binary size is 13MB
instead of 12MB, and the package size on amd64 is 48.7MB instead
of 45.3MB.

R=golang-dev, daniel.morsing, r, khr, rsc, iant
CC=golang-dev
https://golang.org/cl/13698043

11 years agoos/exec: add more caveats to StdoutPipe, StderrPipe
Russ Cox [Fri, 13 Sep 2013 19:43:54 +0000 (15:43 -0400)]
os/exec: add more caveats to StdoutPipe, StderrPipe

(StdinPipe was taken care of by CL 13329043.)

Fixes #6008.

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

11 years agoruntime: avoid inconsistent goroutine state in profiler
Russ Cox [Fri, 13 Sep 2013 18:19:23 +0000 (14:19 -0400)]
runtime: avoid inconsistent goroutine state in profiler

Because profiling signals can arrive at any time, we must
handle the case where a profiling signal arrives halfway
through a goroutine switch. Luckily, although there is much
to think through, very little needs to change.

Fixes #6000.
Fixes #6015.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/13421048

11 years agoreflect: document FieldByName shortcoming
Russ Cox [Fri, 13 Sep 2013 17:56:39 +0000 (13:56 -0400)]
reflect: document FieldByName shortcoming

Fixes #4876.

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

11 years agosyscall: add TCIOFLUSH family of constants
Dave Cheney [Fri, 13 Sep 2013 05:01:22 +0000 (15:01 +1000)]
syscall: add TCIOFLUSH family of constants

Fixes #6355.

zerrors_linux_{386,amd64,arm}.go were regenerated using mkerrors.sh but I opted to add the three TC.*FLUSH lines by hand to keep the diff smaller and avoid problems with the API checker.

I'll check freebsd and darwin, could I ask for help with net/open bsd.

R=mikioh.mikioh, jsing, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/13660043

11 years agocmd/5l: fix handling of RET.EQ in wrapper function
Russ Cox [Fri, 13 Sep 2013 03:50:50 +0000 (03:50 +0000)]
cmd/5l: fix handling of RET.EQ in wrapper function

Keith is too clever for me.

R=ken2
CC=golang-dev, khr
https://golang.org/cl/13272050

11 years agogoyacc: Fix debug printing of the lexed token's ID and name, and add whitespace in...
Jamie Wilkinson [Fri, 13 Sep 2013 03:18:02 +0000 (13:18 +1000)]
goyacc: Fix debug printing of the lexed token's ID and name, and add whitespace in the 'stateX saw' message.

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

11 years agoC: Jamie Wilkinson (Googler CLA)
Rob Pike [Fri, 13 Sep 2013 03:17:47 +0000 (13:17 +1000)]
C: Jamie Wilkinson (Googler CLA)

R=golang-dev, dave, adg, dsymonds
CC=golang-dev
https://golang.org/cl/13692043

11 years agotext/template/parse: mostly roll back the error detection for unmatched right delimiters
Rob Pike [Fri, 13 Sep 2013 02:44:45 +0000 (12:44 +1000)]
text/template/parse: mostly roll back the error detection for unmatched right delimiters
It's too late to change this behavior: it breaks templates with minimized JavaScript.

Makes me sad because this common error can never be caught: "{foo}}".
Three cheers for compatibility.

(Leave in a fix to a broken test.)

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

11 years agocmd/go: do not support code.google.com/r/zzz projects
Russ Cox [Fri, 13 Sep 2013 01:47:56 +0000 (21:47 -0400)]
cmd/go: do not support code.google.com/r/zzz projects

This reverts CL 13261048. I have just learned that these are
no longer supported on code.google.com (that is, it is impossible
to create them), so there is little reason to add support in
Go 1.2.

Update #5408

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

11 years agomisc/dist: include cover and vet, add -tool flag to specify go.tools tag
Andrew Gerrand [Fri, 13 Sep 2013 00:28:30 +0000 (10:28 +1000)]
misc/dist: include cover and vet, add -tool flag to specify go.tools tag

Fixes #6356.

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

11 years agoencoding/xml: add Encoder.Flush
Russ Cox [Thu, 12 Sep 2013 20:54:01 +0000 (16:54 -0400)]
encoding/xml: add Encoder.Flush

Fixes #6365.

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

11 years agoruntime, cmd/gc, cmd/ld: ignore method wrappers in recover
Russ Cox [Thu, 12 Sep 2013 18:00:16 +0000 (14:00 -0400)]
runtime, cmd/gc, cmd/ld: ignore method wrappers in recover

Bug #1:

Issue 5406 identified an interesting case:
        defer iface.M()
may end up calling a wrapper that copies an indirect receiver
from the iface value and then calls the real M method. That's
two calls down, not just one, and so recover() == nil always
in the real M method, even during a panic.

[For the purposes of this entire discussion, a wrapper's
implementation is a function containing an ordinary call, not
the optimized tail call form that is somtimes possible. The
tail call does not create a second frame, so it is already
handled correctly.]

Fix this bug by introducing g->panicwrap, which counts the
number of bytes on current stack segment that are due to
wrapper calls that should not count against the recover
check. All wrapper functions must now adjust g->panicwrap up
on entry and back down on exit. This adds slightly to their
expense; on the x86 it is a single instruction at entry and
exit; on the ARM it is three. However, the alternative is to
make a call to recover depend on being able to walk the stack,
which I very much want to avoid. We have enough problems
walking the stack for garbage collection and profiling.
Also, if performance is critical in a specific case, it is already
faster to use a pointer receiver and avoid this kind of wrapper
entirely.

Bug #2:

The old code, which did not consider the possibility of two
calls, already contained a check to see if the call had split
its stack and so the panic-created segment was one behind the
current segment. In the wrapper case, both of the two calls
might split their stacks, so the panic-created segment can be
two behind the current segment.

Fix this by propagating the Stktop.panic flag forward during
stack splits instead of looking backward during recover.

Fixes #5406.

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

11 years agogo/token: rename RemoveLine to MergeLine, improve documentation
Josh Bleecher Snyder [Thu, 12 Sep 2013 16:31:07 +0000 (09:31 -0700)]
go/token: rename RemoveLine to MergeLine, improve documentation

This is a follow-up to feedback from gri in
https://golang.org/cl/12837044/. Most of the wording
and naming improvements are lifted shamelessly from him.

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

11 years agocrypto/x509: allow ECDSA public keys to be marshaled.
Nicholas Sullivan [Thu, 12 Sep 2013 16:23:34 +0000 (12:23 -0400)]
crypto/x509: allow ECDSA public keys to be marshaled.

The public key serialization from CreateCertificate is factored out to be
used in MarshalPKIXPublicKey.
Testcode with one P224 ECDSA keypair has been added.

R=golang-dev, agl
CC=agl, golang-dev
https://golang.org/cl/13427044

11 years agoA+C: Nicholas Sullivan
Adam Langley [Thu, 12 Sep 2013 15:17:37 +0000 (11:17 -0400)]
A+C: Nicholas Sullivan

Generated by addca.

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

11 years agonet/rpc: document thread safety requirements of codec types.
Han-Wen Nienhuys [Thu, 12 Sep 2013 12:03:53 +0000 (22:03 +1000)]
net/rpc: document thread safety requirements of codec types.

Fixes #6306.

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

11 years agonet/http: document ServeMux handling of pattern "/"
Brad Fitzpatrick [Thu, 12 Sep 2013 10:20:16 +0000 (11:20 +0100)]
net/http: document ServeMux handling of pattern "/"

Fixes #4799

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

11 years agodoc/go1.2.html: cover, template, vet
Rob Pike [Thu, 12 Sep 2013 06:46:08 +0000 (16:46 +1000)]
doc/go1.2.html: cover, template, vet

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

11 years agodoc/go1.2.html: happy eyeballs on net
Mikio Hara [Thu, 12 Sep 2013 06:12:40 +0000 (15:12 +0900)]
doc/go1.2.html: happy eyeballs on net

Also fix trivial nits.

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

11 years agotext/template: catch unmatched right delimiter
Rob Pike [Thu, 12 Sep 2013 03:22:56 +0000 (13:22 +1000)]
text/template: catch unmatched right delimiter
It was simply a missing error case: when scanning plain text
outside of an action, a right delimiter should be an error.

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

11 years agonet: move mock ICMP into separate file
Mikio Hara [Thu, 12 Sep 2013 02:59:18 +0000 (11:59 +0900)]
net: move mock ICMP into separate file

This is in prepartion for fixing issue 6320.

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

11 years agonet: make TestDialFailPDLeak shorter
Mikio Hara [Thu, 12 Sep 2013 02:10:25 +0000 (11:10 +0900)]
net: make TestDialFailPDLeak shorter

Reduces a number of trials but it still can detect memory leak
when we make blunders in runtime-integarted network poller work,
like just forgetting to call runtime_pollClose in code paths.

Also disables the test on windows/386.

R=alex.brainman, r
CC=golang-dev
https://golang.org/cl/13022046

11 years agocmd/8l: fix 386 builds
Dave Cheney [Thu, 12 Sep 2013 01:18:34 +0000 (11:18 +1000)]
cmd/8l: fix 386 builds

Remove set but unused variable.

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

11 years agocmd/5l, cmd/6l, cmd/8l: refactor stack split code
Russ Cox [Thu, 12 Sep 2013 00:29:45 +0000 (20:29 -0400)]
cmd/5l, cmd/6l, cmd/8l: refactor stack split code

Pull the stack split generation into its own function.
This will make an upcoming change to fix recover
easier to digest.

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

11 years agoundo CL 13348045 / 43675523c526
Russ Cox [Thu, 12 Sep 2013 00:29:22 +0000 (20:29 -0400)]
undo CL 13348045 / 43675523c526

There is no reason to do this, and it's more work.

««« original CL description
net: make channel-based semaphore depend on receive, not send

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

»»»

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

11 years agonet/http: explain the "1.1" in the default User-Agent
Russ Cox [Thu, 12 Sep 2013 00:28:14 +0000 (20:28 -0400)]
net/http: explain the "1.1" in the default User-Agent

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

11 years agospec: define s[i:j:k]
Robert Griesemer [Thu, 12 Sep 2013 00:18:52 +0000 (17:18 -0700)]
spec: define s[i:j:k]

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/10243046

11 years agodoc/go1.2.html: status of gccgo's support for 1.2
Rob Pike [Thu, 12 Sep 2013 00:12:26 +0000 (10:12 +1000)]
doc/go1.2.html: status of gccgo's support for 1.2

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

11 years agoA+C: Noah Campbell (individual CLA)
Andrew Gerrand [Thu, 12 Sep 2013 00:11:51 +0000 (10:11 +1000)]
A+C: Noah Campbell (individual CLA)

Generated by addca.

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

11 years agodoc/go1.2.html: some library changes (fmt, template)
Rob Pike [Wed, 11 Sep 2013 23:08:59 +0000 (09:08 +1000)]
doc/go1.2.html: some library changes (fmt, template)
Also link it to the landing page for docs.

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

11 years agocmd/gc: inline copy in frontend to call memmove directly.
Rémy Oudompheng [Wed, 11 Sep 2013 22:15:28 +0000 (00:15 +0200)]
cmd/gc: inline copy in frontend to call memmove directly.

A new node type OSPTR is added to refer to the data pointer of
strings and slices in a simple way during walk(). It will be
useful for future work on simplification of slice arithmetic.

benchmark                  old ns/op    new ns/op    delta
BenchmarkCopy1Byte                 9            8  -13.98%
BenchmarkCopy2Byte                14            8  -40.49%
BenchmarkCopy4Byte                13            8  -35.04%
BenchmarkCopy8Byte                13            8  -37.10%
BenchmarkCopy12Byte               14           12  -15.38%
BenchmarkCopy16Byte               14           12  -17.24%
BenchmarkCopy32Byte               19           14  -27.32%
BenchmarkCopy128Byte              31           26  -15.29%
BenchmarkCopy1024Byte            100           92   -7.50%
BenchmarkCopy1String              10            7  -28.99%
BenchmarkCopy2String              10            7  -28.06%
BenchmarkCopy4String              10            8  -22.69%
BenchmarkCopy8String              10            8  -23.30%
BenchmarkCopy12String             11           11   -5.88%
BenchmarkCopy16String             11           11   -5.08%
BenchmarkCopy32String             15           14   -6.58%
BenchmarkCopy128String            28           25  -10.60%
BenchmarkCopy1024String           95           95   +0.53%

R=golang-dev, bradfitz, cshapiro, dave, daniel.morsing, rsc, khr, khr
CC=golang-dev
https://golang.org/cl/9101048

11 years agocmd/5g, cmd/6g, cmd/8g: remove O(n) reset loop in copyprop
Russ Cox [Wed, 11 Sep 2013 19:22:11 +0000 (15:22 -0400)]
cmd/5g, cmd/6g, cmd/8g: remove O(n) reset loop in copyprop

Simpler version of CL 13084043.

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

11 years agoundo CL 13084043 / ef4ee02a5853
Russ Cox [Wed, 11 Sep 2013 19:14:11 +0000 (15:14 -0400)]
undo CL 13084043 / ef4ee02a5853

There is a cleaner, simpler way.

««« original CL description
cmd/5g, cmd/6g, cmd/8g: faster compilation
Replace linked list walk with memset.
This reduces CPU time taken by 'go install -a std' by ~10%.
Before:
real user sys
0m23.561s 0m16.625s 0m5.848s
0m23.766s 0m16.624s 0m5.846s
0m23.742s 0m16.621s 0m5.868s
after:
0m22.714s 0m14.858s 0m6.138s
0m22.644s 0m14.875s 0m6.120s
0m22.604s 0m14.854s 0m6.081s

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

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/13352049

11 years agocmd/gc: allow x[i:j:k] (and x[:j:k]) into the release
Russ Cox [Wed, 11 Sep 2013 18:55:46 +0000 (14:55 -0400)]
cmd/gc: allow x[i:j:k] (and x[:j:k]) into the release

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

11 years agocmd/api: fix tool for recent go/build change
Russ Cox [Wed, 11 Sep 2013 18:42:34 +0000 (14:42 -0400)]
cmd/api: fix tool for recent go/build change

Asking about runtime/cgo when CgoEnabled=false now correctly
returns an error from build.Import (specifically, NoGoError), because
there are no buildable Go files in that directory.

The API tool was depending on it returning a package with no Go
files instead. Correct that assumption.

Fixes all.bash on local machines.
(Dashboard appears not to be running the api tool at all.)

Update #6124

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13385046

11 years agoundo CL 13632053 / dc7bfe0f022d
Russ Cox [Wed, 11 Sep 2013 18:35:08 +0000 (14:35 -0400)]
undo CL 13632053 / dc7bfe0f022d

It was never going to last.

««« original CL description
cmd/api: break the builds

There is some question about whether the api tool is
running on Windows (see issue 6124), and now I'm
starting to question whether it runs on any of the builders,
since both darwin/amd64 and linux/amd64 are crashing for me
in the api tool due to a recent cgo-related change, and yet
the dashboard is happy.

If the dashboard is still happy after this CL, we have a problem.

Update #6124

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13632053
»»»

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13474045

11 years agocmd/api: break the builds
Russ Cox [Wed, 11 Sep 2013 18:34:11 +0000 (14:34 -0400)]
cmd/api: break the builds

There is some question about whether the api tool is
running on Windows (see issue 6124), and now I'm
starting to question whether it runs on any of the builders,
since both darwin/amd64 and linux/amd64 are crashing for me
in the api tool due to a recent cgo-related change, and yet
the dashboard is happy.

If the dashboard is still happy after this CL, we have a problem.

Update #6124

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13632053

11 years agoruntime: keep args and frame in struct Func
Russ Cox [Wed, 11 Sep 2013 18:18:52 +0000 (14:18 -0400)]
runtime: keep args and frame in struct Func

args is useful for printing tracebacks.

frame is not necessary anymore, but we might some day
get back to functions where the frame size does not vary
by program counter, and if so we'll need it. Avoid needing
to introduce a new struct format later by keeping it now.

Fixes #5907.

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

11 years agogo/build: reject directory with only cgo files if cgo not in use
Russ Cox [Wed, 11 Sep 2013 17:25:30 +0000 (13:25 -0400)]
go/build: reject directory with only cgo files if cgo not in use

The old test for "no Go files" was p.Name == "", meaning we never
saw a Go package statement. That test fails if there are cgo files
that we parsed (and recorded the package name) but then chose
not to use (because cgo is not available).

Test the actual file lists instead.

Fixes #6078.

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

11 years agocmd/yacc: replace units example with simpler expr example
Ian Lance Taylor [Wed, 11 Sep 2013 16:01:47 +0000 (09:01 -0700)]
cmd/yacc: replace units example with simpler expr example

The units example is nice but is covered by the Lucent
license, which may be a concern for some people making a
commercial source code distribution of Go.

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

11 years agoruntime: show m stack during crash on m stack
Russ Cox [Wed, 11 Sep 2013 16:00:37 +0000 (12:00 -0400)]
runtime: show m stack during crash on m stack

The various throwing > 0 finish a change started
in a previous CL, which sets throwing = -1 to mean
"don't show the internals". That gets set during the
"all goroutines are asleep - deadlock!" crash, and it
should also be set during any other expected crash
that does not indicate a problem within the runtime.

Most runtime.throw do indicate a problem within the
runtime, however, so we should be able to enumerate
the ones that should be silent. The goroutine sleeping
deadlock is the only one I can think of.

Update #5139

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

11 years agoruntime: show runtime.panic frame in traceback
Russ Cox [Wed, 11 Sep 2013 15:59:19 +0000 (11:59 -0400)]
runtime: show runtime.panic frame in traceback

Otherwise, if panic starts running deferred functions,
the code that panicked appears to be calling those
functions directly, which is not the case and can be
confusing.

For example:

main.Two()
        /Users/rsc/x.go:12 +0x2a
runtime.panic(0x20dc0, 0x2100cc010)
        /Users/rsc/g/go/src/pkg/runtime/panic.c:248 +0x106
main.One()
        /Users/rsc/x.go:8 +0x55

This makes clear(er) that main.Two is being called during
a panic, not as a direct call from main.One.

Fixes #5832.

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

11 years agonet: defend against broken getaddrinfo on Linux
Russ Cox [Wed, 11 Sep 2013 15:38:56 +0000 (11:38 -0400)]
net: defend against broken getaddrinfo on Linux

getaddrinfo is supposed to set errno when it returns
EAI_SYSTEM, but sometimes it does not.

Fixes #6232.

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

11 years agocmd/cgo: replace C.malloc with our own wrapper
Russ Cox [Wed, 11 Sep 2013 15:30:08 +0000 (11:30 -0400)]
cmd/cgo: replace C.malloc with our own wrapper

This allows us to make two changes:

1. Force the argument type to be size_t, even on broken
   systems that declare malloc to take a ulong.

2. Call runtime.throw if malloc fails.
   (That is, the program crashes; it does not panic.)

Fixes #3403.
Fixes #5926.

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

11 years agonet: implement TCP connection setup with fast failover
Mikio Hara [Wed, 11 Sep 2013 14:48:53 +0000 (10:48 -0400)]
net: implement TCP connection setup with fast failover

This CL adds minimal support of Happy Eyeballs-like TCP connection
setup to Dialer API. Happy Eyeballs and derivation techniques are
described in the following:

- Happy Eyeballs: Success with Dual-Stack Hosts
  http://tools.ietf.org/html/rfc6555

- Analysing Dual Stack Behaviour and IPv6 Quality
  http://www.potaroo.net/presentations/2012-04-17-dual-stack-quality.pdf

Usually, the techniques consist of three components below.

- DNS query racers, that run A and AAAA queries in parallel or series
- A short list of destination addresses
- TCP SYN racers, that run IPv4 and IPv6 transport in parallel or series

This CL implements only the latter two. The existing DNS query
component gathers together A and AAAA records in series, so we don't
touch it here. This CL just uses extended resolveInternetAddr and makes
it possible to run multiple Dial racers in parallel.

For example, when the given destination is a DNS name and the name has
multiple address family A and AAAA records, and it happens on the TCP
wildcard network "tcp" with DualStack=true like the following:

(&net.Dialer{DualStack: true}).Dial("tcp", "www.example.com:80")

The function will return a first established connection either TCP over
IPv4 or TCP over IPv6, and close the other connection internally.

Fixes #3610.
Fixes #5267.

Benchmark results on freebsd/amd64 virtual machine, tip vs. tip+12416043:

benchmark                           old ns/op    new ns/op    delta
BenchmarkTCP4OneShot                    50696        52141   +2.85%
BenchmarkTCP4OneShotTimeout             65775        66426   +0.99%
BenchmarkTCP4Persistent                 10986        10457   -4.82%
BenchmarkTCP4PersistentTimeout          11207        10445   -6.80%
BenchmarkTCP6OneShot                    62009        63718   +2.76%
BenchmarkTCP6OneShotTimeout             78351        79138   +1.00%
BenchmarkTCP6Persistent                 14695        14659   -0.24%
BenchmarkTCP6PersistentTimeout          15032        14646   -2.57%
BenchmarkTCP4ConcurrentReadWrite         7215         6217  -13.83%
BenchmarkTCP6ConcurrentReadWrite         7528         7493   -0.46%

benchmark                          old allocs   new allocs    delta
BenchmarkTCP4OneShot                       36           36    0.00%
BenchmarkTCP4OneShotTimeout                36           36    0.00%
BenchmarkTCP4Persistent                     0            0     n/a%
BenchmarkTCP4PersistentTimeout              0            0     n/a%
BenchmarkTCP6OneShot                       37           37    0.00%
BenchmarkTCP6OneShotTimeout                37           37    0.00%
BenchmarkTCP6Persistent                     0            0     n/a%
BenchmarkTCP6PersistentTimeout              0            0     n/a%
BenchmarkTCP4ConcurrentReadWrite            0            0     n/a%
BenchmarkTCP6ConcurrentReadWrite            0            0     n/a%

benchmark                           old bytes    new bytes    delta
BenchmarkTCP4OneShot                     2500         2503    0.12%
BenchmarkTCP4OneShotTimeout              2508         2505   -0.12%
BenchmarkTCP4Persistent                     0            0     n/a%
BenchmarkTCP4PersistentTimeout              0            0     n/a%
BenchmarkTCP6OneShot                     2713         2707   -0.22%
BenchmarkTCP6OneShotTimeout              2722         2720   -0.07%
BenchmarkTCP6Persistent                     0            0     n/a%
BenchmarkTCP6PersistentTimeout              0            0     n/a%
BenchmarkTCP4ConcurrentReadWrite            0            0     n/a%
BenchmarkTCP6ConcurrentReadWrite            0            0     n/a%

R=golang-dev, bradfitz, nightlyone, rsc
CC=golang-dev
https://golang.org/cl/12416043

11 years agocmd/go: use pattern to prune file tree walk
Russ Cox [Wed, 11 Sep 2013 13:57:05 +0000 (09:57 -0400)]
cmd/go: use pattern to prune file tree walk

For example, if the pattern is m... there is
no need to look in directories not beginning with m.

Fixes #5214.

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

11 years agocmd/cgo: don't say "gcc produced no output" if we ran clang
Russ Cox [Wed, 11 Sep 2013 13:56:51 +0000 (09:56 -0400)]
cmd/cgo: don't say "gcc produced no output" if we ran clang

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

11 years agomisc/cgo/test: test of issue 4339
Russ Cox [Wed, 11 Sep 2013 13:56:38 +0000 (09:56 -0400)]
misc/cgo/test: test of issue 4339

This is not quite what that issue reports,
because this does not involve a DLL.
But I wanted to make sure this much was working.

Update #4339

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13653043

11 years agobytes: additional test coverage
Dave Cheney [Wed, 11 Sep 2013 11:20:15 +0000 (21:20 +1000)]
bytes: additional test coverage

Add coverage for some uncovered bytes methods. The increase in actual coverage is disapointing small.

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

11 years agocmd/api: make api check directory per-user
Robert Daniel Kortschak [Wed, 11 Sep 2013 00:50:56 +0000 (10:50 +1000)]
cmd/api: make api check directory per-user

Fixes #6353.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/13652043

11 years agocmd/go: report correct directory for 'no version control'
Russ Cox [Tue, 10 Sep 2013 19:28:29 +0000 (15:28 -0400)]
cmd/go: report correct directory for 'no version control'

The scan starts at the directory we care about and works
backward to the GOPATH root. The error should say the
original directory name, not the name of the GOPATH root.

Fixes #6175.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13366050

11 years agobuild: more "undefined behavior" fixes
Russ Cox [Tue, 10 Sep 2013 18:54:55 +0000 (14:54 -0400)]
build: more "undefined behavior" fixes

Fixes #5764.

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