Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Checked that the result can still be compiled with Go 1.4.
Change-Id: I06bce110bb5f46ee2f45113681294475aa6968bc
Reviewed-on: https://go-review.googlesource.com/13839
Reviewed-by: Andrew Gerrand <adg@golang.org>
Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Checked that the result can still be compiled with Go 1.4.
Change-Id: I201cd90fdfb8de2971c46ad7fce64111152b697e
Reviewed-on: https://go-review.googlesource.com/13832
Reviewed-by: Andrew Gerrand <adg@golang.org>
One (12466) was an actual logic error, backing up when there was
nothing there. The others were due to continuing to process an
instruction when it cannot work.
Methodically stop assembling an instruction when it's not going to
succeed.
Fixes#12466.
Fixes#12467.
Fixes#12468.
Change-Id: I88c568f2b9c1a8408043b2ac5a78f5e2ffd62abd
Reviewed-on: https://go-review.googlesource.com/14498
Reviewed-by: Andrew Gerrand <adg@golang.org>
If comment of the archive contains data which looks like
a zip64 directory, the comment is parsed as an
actual directory header.
Commit adds some additional checks similar to the checks
in minizip library.
Fixes#12449
Change-Id: Ia0fc950e47b9c39f77d88401b9ca30100ca7c808
Reviewed-on: https://go-review.googlesource.com/14433
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
cmd/dist will re-exec itself to detect VFP support at run-time.
Fixes#9732, #12548.
Change-Id: I9ad0c5c7fa3e97bd79a32da372e1a962565bb3af
Reviewed-on: https://go-review.googlesource.com/3973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
It was correct for an early version of the CL which introduced the
type, but later versions of the CL changed the behavior without
updating the documentation.
Fixes#12568
Change-Id: Ia4090a02ba122e9f8317ed86c4c9839ae2c539e0
Reviewed-on: https://go-review.googlesource.com/14496
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Checked that the result can still be compiled with Go 1.4.
Change-Id: I0a6773d12200a7b43491f25f914335069a1fa5e8
Reviewed-on: https://go-review.googlesource.com/13833
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The construction
fmt.Printf("%*d", n, 4)
reads the argument n as a width specifier to use when printing 4.
Until now, only strict int type was accepted here and it couldn't
be fixed because the fix, using reflection, broke escape analysis
and added an extra allocation in every Printf call, even those that
do not use this feature.
The compiler has been fixed, although I am not sure when exactly,
so let's fix Printf and then write
Fixes#10732.
Change-Id: I79cf0c4fadd876265aa39d3cb62867247b36ab65
Reviewed-on: https://go-review.googlesource.com/14491
Reviewed-by: Ian Lance Taylor <iant@golang.org>
In Parse, one can now say Feb 31 or even Feb 99. This is easy
to explain, consistent with time.Date, and even maybe useful.
Fixes#12333.
Fixes#7268. (By disagreeing with it.)
Change-Id: I7b95c842528bed66933681c8b9cc00640fccfcb4
Reviewed-on: https://go-review.googlesource.com/14123
Reviewed-by: Ian Lance Taylor <iant@golang.org>
this leaves lots of cruft behind, will delete that soon
Change-Id: I12d6b6192f89bcdd89b2b0873774bd3458373b8a
Reviewed-on: https://go-review.googlesource.com/14196
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Disassembler for mips64 is not supported yet.
Change-Id: Ie923dd1e37fed47fc395b9d1cd9194e55020bee5
Reviewed-on: https://go-review.googlesource.com/14459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Because external linking is not supported for now.
Change-Id: Icdd8f3cb3bfb781a990e529fce9129d91e98a9ec
Reviewed-on: https://go-review.googlesource.com/14457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
It went out of its way to look for implicit assignments
but never checked explicit assignments.
This detects the root bug for #12099.
Change-Id: I6a6e774cc38749ea8be7cfd58ba6421247b67000
Reviewed-on: https://go-review.googlesource.com/13646
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
CL 14315 broke the tests for parsing loosely formed remote package
metadata. Switch the parsing to use RawToken to recover the previous
behaviour that Token provided.
It could be argued that the parser should be stricter, but as remote
metadata has been readable with the parser for several years, it is
safer to change the parser to continue to accept the samples provided
in the test cases.
Change-Id: I2a3ba1757d3cff53b1a1c4386276955bb46cf8cd
Reviewed-on: https://go-review.googlesource.com/14482
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This one of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.
This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: Ie02d2cf35f1e8438c6e9dc1d5fba51e8adde1bc0
Reviewed-on: https://go-review.googlesource.com/14480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently, the xml.Decoder's Token routine returns successfully for
XML input that does not properly close root start elements (and any
unclosed descendants). For example, all the following inputs
<root>
<root><foo>
<root><foo></foo>
cause Token to return with nil and io.EOF, indicating a successful
parse.
This change fixes that. It leaves the semantics of RawToken intact.
Fixes#11405
Change-Id: I6f1328c410cf41e17de0a93cf357a69f12c2a9f7
Reviewed-on: https://go-review.googlesource.com/14315
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Context: #12149. The problem there is that contents of
<script type="text/template"> are treated as JS, and thus // is treated
as regexp.
Preserve context.attr while we are in the attribute, in particular in
stateBeforeValue, so we have attr when reading attr value.
Next CL will actually fix the bug.
Change-Id: I99add2237b0885ecdcc08b4f7c25d0af99173e53
Reviewed-on: https://go-review.googlesource.com/14335
Reviewed-by: Rob Pike <r@golang.org>
Check reflect.Value.IsValid() before calling other reflect.Value methods
that panic on zero values.
Added tests for cases with untyped nils. They panicked without these fixes.
Removed a TODO.
Fixes#12356
Change-Id: I9b5cbed26db09a0a7c36d99a93f8b9729899d51e
Reviewed-on: https://go-review.googlesource.com/14340
Reviewed-by: Rob Pike <r@golang.org>
Keep track of which types of keys need an update and which don't.
Strings need an update because the new key might pin a smaller backing store.
Floats need an update because it might be +0/-0.
Interfaces need an update because they may contain strings or floats.
Fixes#11088
Change-Id: I9ade53c1dfb3c1a2870d68d07201bc8128e9f217
Reviewed-on: https://go-review.googlesource.com/10843
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
In support of the changes required for #8609, it was suggested that
syscall.getwd() be updated to work on Solaris first since the runtime
uses it and today it's unimplemented.
Fixes#12507
Change-Id: Ifb58ac9db8540936d5685c2c58bdc465dbc836cb
Reviewed-on: https://go-review.googlesource.com/14420
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Trivial fix: set unexported=true for builtin.
Godoc itself has a similar hack.
Fixes#12541
Change-Id: Ib701f867d117931eb6ec6de223941b52eb6cd4a7
Reviewed-on: https://go-review.googlesource.com/14441
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We compute whether two keys k1 and k2 in a map literal are duplicates by
constructing the expression OEQ(k1, k2) and calling the constant
expression evaluator on that expression, then extracting the boolean
result.
Unfortunately, the constant expression evaluator can fail for various
reasons. I'm not really sure why it is dying in the case of 12536, but
to be safe we should use the result only if we get a constant back (if
we get a constant back, it must be boolean). This probably isn't a
permanent fix, but it should be good enough for 1.5.2.
A permanent fix would be to ensure that the constant expression
evaluator can always work for map literal keys, and if not the compiler
should generate an error saying that the key isn't a constant (or isn't
comparable to some specific other key).
This patch has the effect of allowing the map literal to compile when
constant eval of the OEQ fails. If the keys are really equal (which the
map impl will notice at runtime), one will overwrite the other in the
resulting map. Not great, but better than a compiler crash.
Fixes#12536
Change-Id: Ic151a5e3f131c2e8efa0c25c9218b431c55c1b30
Reviewed-on: https://go-review.googlesource.com/14400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Convert two fields of struct TempVar in popt.go from uint8 to bool.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I1aa14313e0241a4e9cadd63c6c681ed4e965a9a3
Reviewed-on: https://go-review.googlesource.com/14377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Convert two fields of struct Symlink in subr.go from uint8 to bool.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I913006f41605b17b0d82fe358ee773f6ecaa681c
Reviewed-on: https://go-review.googlesource.com/14378
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Borrowing a suggestion from the issue listed below, we modify the lexer to
trim spaces at the beginning (end) of a block of text if the action immediately
before (after) is marked with a minus sign. To avoid parsing/lexing ambiguity,
we require an ASCII space between the minus sign and the rest of the action.
Thus:
{{23 -}}
<
{{- 45}}
produces the output
23<45
All the work is done in the lexer. The modification is invisible to the parser
or any outside package (except I guess for noticing some gaps in the input
if one tracks error positions). Thus it slips in without worry in text/template
and html/template both.
Fixes long-requested issue #9969.
Change-Id: I3774be650bfa6370cb993d0899aa669c211de7b2
Reviewed-on: https://go-review.googlesource.com/14391
Reviewed-by: Andrew Gerrand <adg@golang.org>
Block comments appear after a block in the HTML documentation generated by
godoc. Words like "following" should be avoided.
Change-Id: Iedfad67f4b8b9c84f128b98b9b06fa76919af388
Reviewed-on: https://go-review.googlesource.com/14357
Reviewed-by: Rob Pike <r@golang.org>
http://www.w3.org/TR/PNG/#11IHDR says that "Zero is an invalid value".
This change only affects the decoder. The encoder already checks
non-positive instead of negative.
Fixes#12545.
Change-Id: Iba40e1a2f4e0eec8b2fbcd3bbdae886311434da7
Reviewed-on: https://go-review.googlesource.com/14411
Reviewed-by: Rob Pike <r@golang.org>
Also run testcshared.
Fixes#12425
Change-Id: I5baea8d772d3462f945aab96260b4197dbb20c0a
Reviewed-on: https://go-review.googlesource.com/14143
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Currently the stack barrier code is mixed in with the mark and scan
code. Move all of the stack barrier related functions and variables to
a new dedicated source file. There are no code modifications.
Change-Id: I604603045465ef8573b9f88915d28ab6b5910903
Reviewed-on: https://go-review.googlesource.com/14050
Reviewed-by: Rick Hudson <rlh@golang.org>
Following on from CL 14350, remove the remaining dead code from data.go.
Also leave a TODO to be addressed later (with a unit test) to reduce
the overhead of SymGrow.
Change-Id: Iebad775b1280b54b89e87a3a073ca8af19a8bfba
Reviewed-on: https://go-review.googlesource.com/14359
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently Go produces shared libraries that cannot be shared between processes
because they have relocations against the text segment (not text section). This
fixes this by moving some data to sections with magic names recognized by the
static linker.
The change in genasmsym to add STYPELINK to the switch should fix things on
darwin/arm64.
Fixes#10914
Updates #9210
Change-Id: Iab4a6678dd04cec6114e683caac5cf31b1063309
Reviewed-on: https://go-review.googlesource.com/14306
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Just a mechanical copy, no code changes.
This is to reduce code difference when adding the mips64 port.
Change-Id: Id06e975f414a7b09f4827167b30813b228a3bfaf
Reviewed-on: https://go-review.googlesource.com/14324
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Just a mechanical copy with filename renames, no code changes.
This is to reduce code difference when adding the mips64 port.
Change-Id: Id06e975f414a7b09f4827167b30813b228a3bfae
Reviewed-on: https://go-review.googlesource.com/14323
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This version of quoting allows runes in category Zs, such as the
ideographic space characters, to be passed through unquoted.
Still to do (maybe): A way to access this from Printf.
Updates #11511.
Change-Id: I3bae84b1aa0bc1b885318d3f67c5f451099a2a5a
Reviewed-on: https://go-review.googlesource.com/14184
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Convert some fields of struct Type in go.go from uint8 to bool.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I0a6c53f8ee686839b5234010ee2de7ae3940d499
Reviewed-on: https://go-review.googlesource.com/14370
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Convert Type.Broke from a uint8 to a boolean
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I44e7548c71b00467e36576bdf62933c42555a21a
Reviewed-on: https://go-review.googlesource.com/14307
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Håvard Haugen <havard.haugen@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Convert Label.Used to a boolean. Also move the field to the
bottom of the struct to avoid padding.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: If09ee92f9d54dce807e7b862cf771005daed810d
Reviewed-on: https://go-review.googlesource.com/14308
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When building a shared library, all functions that are declared must actually
be defined.
Change-Id: I1488690cecfb66e62d9fdb3b8d257a4dc31d202a
Reviewed-on: https://go-review.googlesource.com/14187
Reviewed-by: Dave Cheney <dave@cheney.net>
Fix mkzversion to produce correctly formatted runtime/zversion.go.
Change-Id: Ie6bcd361a2f2e390b7f6c4980fcae2c41bb7e52f
Reviewed-on: https://go-review.googlesource.com/14355
Reviewed-by: Andrew Gerrand <adg@golang.org>
This one of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.
This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I4d041b343952f4a31f3150fd70669e08fcaa74f8
Reviewed-on: https://go-review.googlesource.com/14305
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The code parsing register lists involves an inner loop on
each range defined by the lo,hi bounds. The condition on
this loop (for lo<=hi) is fragile, because the bounds
are unsigned 16 bits numbers.
In some corner cases, the calculated upper bound is 2^16-1
leading to an infinite loop.
Parsing operand `[):[o-FP` results in:
- an infinite loop for non ARM architectures
- the generation of almost 2^16 errors for the ARM architecture
(which are then ignored)
This CL improves the code in 3 ways:
- bail out early when parsing non R prefixed registers
- make sure the register index is never negative
- make sure the number of iterations is limited by the
maximum size of the range (as a defensive measure).
Fixes#12469
Change-Id: Ib1e7e36fb8ad5a3a52c50fc6219d3cfe2b39cc34
Reviewed-on: https://go-review.googlesource.com/14314
Reviewed-by: Rob Pike <r@golang.org>
This one of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.
This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I582ff8b077eb384b84721a1edb0c1efbc0c40059
Reviewed-on: https://go-review.googlesource.com/14304
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
When running an experimental kernel with IPv4 disabled, Listen(":port")
currently tries to create an AF_INET socket, and fails. Instead, it
should see !supportsIPv4, and use an AF_INET6 socket.
This sort of environment is quite esoteric at the moment, but I can
force the tests to fail on regular Linux using the following tweaks:
- net/net.go: supportsIPv4, supportsIPv6, supportsIPv4map = false, true, false
- net/sockopt_linux.go: ipv6only=true
- net/ipsock_posix.go: Revert this fix
- ./make.bash && ../bin/go test net
Also, make the arrows in server_test.go point to the left, because
server<-client is easier to read.
Fixes#12510
Change-Id: I0cc3b6b08d5e6908d2fbf8594f652ba19815aa4b
Reviewed-on: https://go-review.googlesource.com/14334
Run-TryBot: Paul Marks <pmarks@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This is a first of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.
This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: Iad10b75e42b5b24e1694407841282fa3bab2dc9f
Reviewed-on: https://go-review.googlesource.com/14232
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is more correct with respect to garbage collection.
I don't know of any specific failures it could cause today.
Change-Id: I7eed6a06d2f281051199e79e4a9913aa8360ded7
Reviewed-on: https://go-review.googlesource.com/14137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Also go generate to update generated files.
Change-Id: I049708db93455f0030ba5afc6f218fde6220958d
Reviewed-on: https://go-review.googlesource.com/14331
Reviewed-by: Damien Neil <dneil@google.com>
TestNoteReading fails on Solaris with linkmode=external due to some
assumptions made about how ELF .note sections are written by some
linkers.
On current versions of Solaris and older derivatives, SHF_ALLOC is
intentionally ignored for .note sections unless the .note section is
assigned to the text segment via a mapfile. Also, if .note sections
are assigned to the text segment, no PT_NOTE program header will be
created thwarting Go's attempts at attempting to quickly find the
.note.
Furthermore, Go assumes that the relevant note segment will be placed
early in the file while the Solaris linker currently places the note
segment last in the file, additionally thwarting Go's optimisation
attempts that read only the first 16KB of the file to find the
buildid.
The fix is to detect when the note section is outside of the first
16KB of the file and then fallback to additionally reading that
section of the file. This way, in future versions of Solaris when
this linking behaviour is changed, the fast path will always succeed
and we'll only be slower if it fails; likewise, any other linker that
does this will also just work.
Fixes#12178
Change-Id: I61c1dc3f744ae3ad63938386d2ace8a432c0efe1
Reviewed-on: https://go-review.googlesource.com/14210
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
This reverts commit 2c2cbb69c8.
Broke darwin/arm64
Change-Id: Ibd2dea475d6ce6a8b4b40e2da19a83fc0514025d
Reviewed-on: https://go-review.googlesource.com/14301
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Optimize two calls of io.Copy which cannot make use of neither
io.ReaderFrom nor io.WriterTo optimization tricks by replacing them with
io.CopyBuffer with reusable buffers.
First is fallback call to io.Copy when server misses the optimized case
of using sendfile to copy from a regular file to net.TCPConn; second is
use of io.Copy on piped reader/writer when handler implementation uses
http.CloseNotifier interface. One of the notable users of
http.CloseNotifier is httputil.ReverseProxy.
benchmark old ns/op new ns/op delta
BenchmarkCloseNotifier-4 309591 303388 -2.00%
benchmark old allocs new allocs delta
BenchmarkCloseNotifier-4 50 49 -2.00%
benchmark old bytes new bytes delta
BenchmarkCloseNotifier-4 36168 3140 -91.32%
Fixes#12455
Change-Id: I512e6aa2f1aeed2ed00246afb3350c819b65b87e
Reviewed-on: https://go-review.googlesource.com/14177
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Checked that the result can still be compiled with Go 1.4.
Change-Id: I5c58801c20919618d2ad52b8e2380d53df2783f1
Reviewed-on: https://go-review.googlesource.com/13831
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
All the code was there to do this, it just wasn't hooked up.
Fixes#10914
Change-Id: Ide8f9bbe50fecb5d11cd579915ee98d4c7efe403
Reviewed-on: https://go-review.googlesource.com/14142
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This is generated during fp code when -shared is active.
Change-Id: Ia1092299b9c3b63ff771ca4842158b42c34bd008
Reviewed-on: https://go-review.googlesource.com/14286
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Some symbols, for example, masks requires 16-byte alignment, and
they are placed in the text section. Before this change, the text
section is only aligned to 4-byte, and it's making masks unaligned.
Fixes#12415.
Change-Id: I7767778d1b4f7d3e74c2719a02848350782a4160
Reviewed-on: https://go-review.googlesource.com/14166
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Currently Go produces shared libraries that cannot be shared between processes
because they have relocations against the text segment (not text section). This
fixes this by moving some data to sections with magic names recognized by the
static linker.
Fixes#10914
Updates #9210
Change-Id: I7178daadc0ae87953d5a084aa3d580f4e3b46d47
Reviewed-on: https://go-review.googlesource.com/10300
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The lexer needs to process all #if[n]defs, even those found when processing is
disabled by a preceding failed conditional, or the first #endif in something
like:
#ifdef <undefined>
#ifdef whatever
#endif
#endif
terminates the first #ifdef and the second causes an error. And then the
processing of the inner #ifdefs needs to ignore their argument when they are
disabled by an outer failed condition.
Change-Id: Iba259498f1e16042f5b7580b9c000bb0599733d0
Reviewed-on: https://go-review.googlesource.com/14253
Reviewed-by: Rob Pike <r@golang.org>
Allow registry blobs to be as large as 500MB
Update #12493
Change-Id: I1d0e5c10772d25f8e7e17fed6e2e7dd12ca4e7cf
Reviewed-on: https://go-review.googlesource.com/14287
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
And do it properly so freebsd and nacl still work.
Change-Id: I6f9f30e93ceae6dee59215ed608c6a158bdbdbb0
Reviewed-on: https://go-review.googlesource.com/14280
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Explicitly say that *Table returned by MakeTable may not be
modified. Otherwise, this leads to very subtle bugs that may
or may not manifest themselves.
Same comment was made on package crc64, to keep the future
open to the caching tables that crc32 effectively does.
Fixes: #12487.
Change-Id: I2881bebb8b16f6f8564412172774c79c2593c6c1
Reviewed-on: https://go-review.googlesource.com/14258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The default implementation of Accept, which spins up a new server
for every new connection, calls log.Fatal if the listener is closed,
stopping any outstanding work. Change that to a non-fatal log
call so work can continue.
There is no programmatic signaling of the problem, just the log,
but that should be enough.
Fixes#11221.
Change-Id: I7c7f6164a0a0143236729eb778d7638c51c34ed1
Reviewed-on: https://go-review.googlesource.com/14185
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
These instructions are special cases that were missed in the translation.
The second argument must go into the Reg field not the To field.
Fixes#12458
For Go 1.5.1
Change-Id: Iad57c60c7e38e3bcfafda483ed5037ce670e8816
Reviewed-on: https://go-review.googlesource.com/14183
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
Previously Tx.close always passed a nil error to tx.db.putConn. As a
result bad connections were reused, even if the driver returned
driver.ErrBadConn. Adding an err parameter to Tx.close allows it to
receive the driver error from Tx.Commit and Tx.Rollback and pass it
to tx.db.putConn.
Fixes#11264
Change-Id: I142b6b2509fa8d714bbc135cef7281a40803b3b8
Reviewed-on: https://go-review.googlesource.com/13912
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Also simplifies some silliness around making the .tbss section wrt internal
vs external linking. The "make TLS make sense" project has quite a few more
steps to go.
Issue #11270
Change-Id: Ia4fa135cb22d916728ead95bdbc0ebc1ae06f05c
Reviewed-on: https://go-review.googlesource.com/13990
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Nothing uses it any more.
Change-Id: I42ee7222b06b1a79b8b44894f3071752f9166d7a
Reviewed-on: https://go-review.googlesource.com/14193
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
The flate library contains generator code, which is used to generate
the fixed huffman table. This is done so that fixed blocks can be
processed quicker since there is no need generate the decoder table
for fixed codes.
Instead, delete the precomputed table, and use sync.Once to generate
it at runtime when used.
Advantages:
* Reduces duplicated logic in flate package
* Reduces binary size by approximately 2KiB
Disadvantages:
* For the simplest possible program that simply decodes the fixed
block "\x03\x00" once, the modified code takes 4.7% longer for the
first decode. Compression performance for subsequent blocks afterwards
has no noticeable slow down.
Change-Id: I8f351218debf7d732118808859eda481b01011f6
Reviewed-on: https://go-review.googlesource.com/14181
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Building for shared libraries requires that all functions that are declared
have an implementation and vice versa so make that so on arm64.
It would be nicer to not require the stub sigreturn (it will never be called)
but that seems a bit awkward.
Change-Id: I3cec81697161b452af81fa35939f748bd1acf7fd
Reviewed-on: https://go-review.googlesource.com/13995
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The parser tries to read as much information as possible,
issuing some errors when needed. Errors generally do not
stop the parsing.
With some pathological input, it may result in various
panics when the error message itself is built, or when the
next operand is parsed. It happens while parsing
pseudo-instructions.
For instance, the following lines all generate a panic:
TEXT
TEXT%
TEXT 1,1
TEXT $"toto", 0, $1
FUNCDATA
DATA 0
DATA(0),1
FUNCDATA(SB
GLOBL 0, 1
PCDATA 1
Added corresponding tests.
Introduced a writer in the parser to capture error messages
for testing purpose. It defaults to os.Stderr.
Added an explicit check when symbol names cannot be displayed.
Interrupted parsing early when the number of operands is wrong for
pseudo-instructions.
Note that the last point is a change of behavior, because some
operands will not get parsed anymore in case of early error.
IMO, it is acceptable, because only the first error of the line
is considered anyway. If it is not acceptable, it can probably
be improved at the price of a more verbose CL.
Fixes#11765Fixes#11760Fixes#11759
Change-Id: I9602a848132e358a1bccad794d7555e0823970dd
Reviewed-on: https://go-review.googlesource.com/13925
Reviewed-by: Rob Pike <r@golang.org>
Refine the documentation in cmd/doc and go help doc.
Fixes#12377.
Change-Id: I670c0a5cf18c9c9d5bb9bb222d8a3dd3722a3934
Reviewed-on: https://go-review.googlesource.com/14121
Reviewed-by: Andrew Gerrand <adg@golang.org>
Printing a function value is nearly useless outside of debugging, but
can occur by mistake when one forgets to call it. Diagnose this.
I did this myself just the other day and it arose in cl/14031.
Easy to fix and seems worthwhile.
Fixes#12295.
Change-Id: Ice125a84559f0394f7fa7272b5d31ae602b07f83
Reviewed-on: https://go-review.googlesource.com/14122
Reviewed-by: Andrew Gerrand <adg@golang.org>
At the moment, bootstrap.bash assumes it is called from a git working
copy. Hence, it fails to complete when running in an unpacked official
source tarball where .git and .gitignore do not exist. This fix adds a
test for existence for .git and a -f switch for the removal of
.gitignore.
Fixes#12223
Change-Id: I7f305b83b38d5115504932bd38dadb7bdeb5d487
Reviewed-on: https://go-review.googlesource.com/13770
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Andrew Gerrand <adg@golang.org>
We could undoubtedly squeeze even more out of these loops, and in the
long term, a better compiler would be smarter with bounds checks, but in
the short term, this small change is an easy win.
benchmark old ns/op new ns/op delta
BenchmarkFillOver-8 1619470 1323192 -18.29%
BenchmarkCopyOver-8 1129369 1062787 -5.90%
BenchmarkGlyphOver-8 420070 378608 -9.87%
On github.com/golang/freetype/truetype's BenchmarkDrawString:
benchmark old ns/op new ns/op delta
BenchmarkDrawString-8 9561435 8807019 -7.89%
Change-Id: Ib1c6271ac18bced85e0fb5ebf250dd57d7747e75
Reviewed-on: https://go-review.googlesource.com/14093
Reviewed-by: Rob Pike <r@golang.org>
This may fix the flakiness on Windows/x64, assuming that it's actually
due to a variance in the connection time which slightly exceeds 100ms.
150ms + 95ms = 245ms, which is still low enough to avoid triggering
Happy Eyeballs (300ms) on non-Windows platforms.
Updates #12309
Change-Id: I816a36fbc0a3e5c90e3cf1b75a134faf0d91557c
Reviewed-on: https://go-review.googlesource.com/14120
Run-TryBot: Paul Marks <pmarks@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Update #10994
CASE and BCASE were used by 5c in switch statements, cmd/compile
does not use them.
Change-Id: I7a578c461b52b94690e35460926849b28971b770
Reviewed-on: https://go-review.googlesource.com/14009
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The hash tests generate occasional failures, quiet them some more.
In particular we can get 1 collision when the expected number is
.001 or so. That shouldn't be a dealbreaker.
Fixes#12311
Change-Id: I784e91b5d21f4f1f166dc51bde2d1cd3a7a3bfea
Reviewed-on: https://go-review.googlesource.com/13902
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Change-Id: If0d00999c58f7421e4da06e1822ba5abccf72cac
Reviewed-on: https://go-review.googlesource.com/14111
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This is basic validation and should be performed early
Fixes#12412
Change-Id: I903f7eeafdc22376704985a53d649698cf9d8ef4
Reviewed-on: https://go-review.googlesource.com/14110
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Fixes#10994
CASE and BCASE were used by 7c in switch statements, cmd/compile
does not use them, cmd/assemble couldn't assemble them, and the arm64
peephole optimiser didn't know about them.
Change-Id: Id04835fcb37e207f76d211ce54a4db9c057d6112
Reviewed-on: https://go-review.googlesource.com/14100
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
All implementations of File.read ensure that n >= 0. This is usually via
fixCount, except for Windows console reads, which only ever add to n.
Change-Id: Ic019d6a2da5ef1ac68d2690c908deca4fcc6b4a4
Reviewed-on: https://go-review.googlesource.com/12624
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This helps vet see a real issue:
cmd/internal/gc$ go vet
gen.go:1223: unreachable code
Fixes#12106.
Change-Id: I720868b07ae6b6d5a4dc6b238baa8c9c889da6d8
Reviewed-on: https://go-review.googlesource.com/14083
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
And clean up the mess on arm64 (the mess on arm is too confusing).
See issue #10050
Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c
Reviewed-on: https://go-review.googlesource.com/13884
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Currently the stack barrier stub blindly unwinds the next stack
barrier from the G's stack barrier array without checking that it's
the right stack barrier. If through some bug the stack barrier array
position gets out of sync with where we actually are on the stack,
this could return to the wrong PC, which would lead to difficult to
debug crashes. To address this, this commit adds a check to the amd64
stack barrier stub that it's unwinding the correct stack barrier.
Updates #12238.
Change-Id: If824d95191d07e2512dc5dba0d9978cfd9f54e02
Reviewed-on: https://go-review.googlesource.com/13948
Reviewed-by: Russ Cox <rsc@golang.org>
Currently enabling the debugging mode where stack barriers are
installed at every frame requires recompiling the runtime. However,
this is potentially useful for field debugging and for runtime tests,
so make this mode a GODEBUG.
Updates #12238.
Change-Id: I6fb128f598b19568ae723a612e099c0ed96917f5
Reviewed-on: https://go-review.googlesource.com/13947
Reviewed-by: Russ Cox <rsc@golang.org>
Currently the runtime can install stack barriers in any frame.
However, the frame of cgocallback_gofunc is special: it's the one
function that switches from a regular G stack to the system stack on
return. Hence, the return PC slot in its frame on the G stack is
actually used to save getg().sched.pc (so tracebacks appear to unwind
to the last Go function running on that G), and not as an actual
return PC for cgocallback_gofunc.
Because of this, if we install a stack barrier in cgocallback_gofunc's
return PC slot, when cgocallback_gofunc does return, it will move the
stack barrier stub PC in to getg().sched.pc and switch back to the
system stack. The rest of the runtime doesn't know how to deal with a
stack barrier stub in sched.pc: nothing knows how to match it up with
the G's stack barrier array and, when the runtime removes stack
barriers, it doesn't know to undo the one in sched.pc. Hence, if the C
code later returns back in to Go code, it will attempt to return
through the stack barrier saved in sched.pc, which may no longer have
correct unwinding information.
Fix this by blacklisting cgocallback_gofunc's frame so the runtime
won't install a stack barrier in it's return PC slot.
Fixes#12238.
Change-Id: I46aa2155df2fd050dd50de3434b62987dc4947b8
Reviewed-on: https://go-review.googlesource.com/13944
Reviewed-by: Russ Cox <rsc@golang.org>
https://tools.ietf.org/html/rfc7301#section-3.1 specifies that a
ProtocolName may not be empty. This change enforces this for ServerHello
messages—it's already enforced for ClientHello messages.
Change-Id: Ic5a5be6bebf07fba90a3cabd10b07ab7b4337f53
Reviewed-on: https://go-review.googlesource.com/12003
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
In Go 1.5, Config.Certificates is no longer required if
Config.GetCertificate has been set. This change updated four comments to
reflect that.
Change-Id: Id72cc22fc79e931b2d645a7c3960c3241042762c
Reviewed-on: https://go-review.googlesource.com/13800
Reviewed-by: Adam Langley <agl@golang.org>
The existing implementation didn't use the CLMUL instructions for fast
and constant time binary-field multiplication. With this change, amd64
CPUs that support both AES and CLMUL instructions will use an optimised
asm implementation.
benchmark old ns/op new ns/op delta
BenchmarkAESGCMSeal8K 91723 3200 -96.51%
BenchmarkAESGCMOpen8K 91487 3324 -96.37%
BenchmarkAESGCMSeal1K 11873 546 -95.40%
BenchmarkAESGCMOpen1K 11833 594 -94.98%
benchmark old MB/s new MB/s speedup
BenchmarkAESGCMSeal8K 89.31 2559.62 28.66x
BenchmarkAESGCMOpen8K 89.54 2463.78 27.52x
BenchmarkAESGCMSeal1K 86.24 1872.49 21.71x
BenchmarkAESGCMOpen1K 86.53 1721.78 19.90x
Change-Id: Idd63233098356d8b353d16624747b74d0c3f193e
Reviewed-on: https://go-review.googlesource.com/10484
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Go 1.5 allowed TLS connections where Config.Certificates was nil as long
as the GetCertificate callback was given. However, tls.Listen wasn't
updated accordingly until this change.
Change-Id: I5f67f323f63c988ff79642f3daf8a6b2a153e6b2
Reviewed-on: https://go-review.googlesource.com/13801
Reviewed-by: Adam Langley <agl@golang.org>
Recursive types R containing slices of R's did not terminate despite the
effort in CL 10821.
For recursive types there was a competition between slice expansion by a
factor 'complexSize', and termination with probability '1/complexSize'
which lead to stack overflow as soon as a recursive struct had slices
pointing to its own type.
Fix this by shrinking the size hint as a function of recursion depth.
This has the dual effect of reducing the number of elements generated
per slice and also increasing the probability for termination.
Fixes#11148.
Change-Id: Ib61155b4f2e2de3873d508d63a1f4be759426d67
Reviewed-on: https://go-review.googlesource.com/13830
Reviewed-by: Adam Langley <agl@golang.org>
For primes which are 3 mod 4, using Tonelli-Shanks is slower
and more complicated than using the identity
a**((p+1)/4) mod p == sqrt(a)
For 2^450-2^225-1 and 2^10860-2^5430-1, which are 3 mod 4:
BenchmarkModSqrt225_TonelliTri 1000 1135375 ns/op
BenchmarkModSqrt225_3Mod4 10000 156009 ns/op
BenchmarkModSqrt5430_Tonelli 1 3448851386 ns/op
BenchmarkModSqrt5430_3Mod4 2 914616710 ns/op
~2.6x to 7x faster.
Fixes#11437 (which is a prime choice of issues to fix)
Change-Id: I813fb29454160483ec29825469e0370d517850c2
Reviewed-on: https://go-review.googlesource.com/11522
Reviewed-by: Adam Langley <agl@golang.org>
Val.Ctype used to be struct field, it's now a method.
Change-Id: I08f0b32b66dba15b2a392e84a557efb905b530cb
Reviewed-on: https://go-review.googlesource.com/14031
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The code is now in cmd/vendor/golang.org/x/arch.
Change-Id: I518d48c21b0d7fed914552b89ee41411f088456b
Reviewed-on: https://go-review.googlesource.com/14021
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
For use by cmd/objdump in place of the current cmd/internal/rsc.io/... tree.
Change-Id: I7d765ddf43ab4118a3221fd755ff0a2a02daa5de
Reviewed-on: https://go-review.googlesource.com/13979
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Right now we find out implicitly if stack barriers are in place,
or defers. This change makes sure we find out about short
unwinds always.
Change-Id: Ibdde1ba9c79eb792660dcb7aa6f186e4e4d559b3
Reviewed-on: https://go-review.googlesource.com/13966
Reviewed-by: Austin Clements <austin@google.com>
GetMUIStringValue tries as a convenience to resolve string values even for pathless
resource DLLs by searching the system directory (one of several paths used
by the system's standard DLL search order algorithm). This would not be
needed if regLoadMUIString searched for pathless DLLs itself, but it
doesn't, instead it needs an absolute path, otherwise it will fail.
This approach works fine for solving issue #12015 (handle localized time
zone names; for which GetMUIStringValue was created) since tzres.dll that
is used to resolve localized time zone names has no path in the registry
but is located under the system directory.
However, this approach will fail if a pathless DLL is located somewhere
else than the system directory.
Because of this limitation GetMUIStringValue may have to be revised in the
future to allow for custom paths, possibly through another version of the
function.
See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724890%28v=vs.85%29.aspxhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx
Change-Id: Ida66a0ef1928e0461ce248c795827902d785e6cd
Reviewed-on: https://go-review.googlesource.com/13929
Reviewed-by: Rob Pike <r@golang.org>
Fixes#11961
Minux removed the use of SRPC in 003dccfa, but the SRPC name service
code was left in the tree. SRPC was removed in pepper_42 making the
code, which ran on startup, fail, even though it was not used.
Removing srpc_nacl.go for a total diff of -822 lines has got to count
as one of the easiest nacl fixes we've had to date.
Change-Id: Ic4e348146bfe47450bbb9cabb91699ba153e6bf0
Reviewed-on: https://go-review.googlesource.com/13958
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Issue 6754 reports that Go bzip2 Decode function is much slower
(about 2.5x in go1.5) than the Python equivalent (which is
actually just a wrapper around the usual C library) on random data.
Profiling the code shows that half a dozen of CMP instructions in a
tight loop are responsibile for most of the execution time.
This patch reduces the number of branches of the loop, greatly
improving performance on random data and speeding up decoding of
real data.
name old time/op new time/op delta
DecodeDigits-4 9.28ms ± 1% 8.05ms ± 1% -13.18% (p=0.000 n=15+14)
DecodeTwain-4 28.9ms ± 2% 26.4ms ± 1% -8.57% (p=0.000 n=15+14)
DecodeRand-4 3.94ms ± 1% 3.06ms ± 1% -22.45% (p=0.000 n=15+14)
name old speed new speed delta
DecodeDigits-4 4.65MB/s ± 1% 5.36MB/s ± 1% +15.21% (p=0.000 n=13+14)
DecodeTwain-4 4.32MB/s ± 2% 4.72MB/s ± 1% +9.36% (p=0.000 n=15+14)
DecodeRand-4 4.27MB/s ± 1% 5.51MB/s ± 1% +28.86% (p=0.000 n=15+14)
I've run some benchmark comparing Go bzip2 implementation with the
usual Linux bzip2 command (which is written in C). On my machine
this patch brings go1.5
from ~2.26x to ~1.50x of bzip2 time (on 64MB random data)
from ~1.70x to ~1.50x of bzip2 time (on 100MB english text)
from ~2.00x to ~1.88x of bzip2 time (on 64MB /dev/zero data)
Fixes#6754
Change-Id: I3cb12d2c0c2243c1617edef1edc88f05f91d26d1
Reviewed-on: https://go-review.googlesource.com/13853
Reviewed-by: Nigel Tao <nigeltao@golang.org>
If we're going to do this for Go 1.6 we might as well do it now
and find out what breaks.
Change-Id: I8306b7829d8d13b564a1466c902ec6ba1a5a58c1
Reviewed-on: https://go-review.googlesource.com/13967
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This worked in Go 1.4 but was lost in the "pure Go" lookup
routines substituted late in the Go 1.5 cycle.
Fixes#12263.
Change-Id: I77ec9d97cd8e67ace99d6ac965e5bc16c151ba83
Reviewed-on: https://go-review.googlesource.com/13915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Setgroups with zero-length groups is no-op for changing groups and
supposed to be used only for determining curent groups length. Also
because we deny setgroups by default if use GidMappings we have
unnecessary error from that no-op syscall.
Change-Id: I8f74fbca9190a3dcbbef1d886c518e01fa05eb62
Reviewed-on: https://go-review.googlesource.com/13938
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Change-Id: I63bf6d2fdf41b49ff8783052d5d6c53b20e2f050
Reviewed-on: https://go-review.googlesource.com/13760
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
For ARM machines, the assembler supports list of registers
operands such as [R1,R2].
A list missing a ']' results in the parser issuing many errors
and consuming all the tokens. At EOF (i.e. end of the line),
it still loops.
Normally, a counter is maintained to make sure the parser
stops after 10 errors. However, multiple errors occuring on the
same line are simply ignored. Only the first one is reported.
At most one error per line is accounted.
Missing ']' in a register list therefore results in an
infinite loop.
Fixed the parser by explicitly checking for ']' to interrupt
this loops
In the operand tests, also fixed a wrong entry which I think was
not set on purpose (but still led to a successful result).
Fixes#11764
Change-Id: Ie87773388ee0d21b3a2a4cb941d4d911d0230ba4
Reviewed-on: https://go-review.googlesource.com/13920
Reviewed-by: Rob Pike <r@golang.org>
I noticed that they were unimplemented on arm64 but then that they were
in fact not used at all.
Change-Id: Iee579feda2a5e374fa571bcc8c89e4ef607d50f6
Reviewed-on: https://go-review.googlesource.com/13951
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Accepting a request with a nil body was never explicitly supported but
happened to work in the past.
This doesn't happen in most cases because usually people pass
a Server's incoming Request to the ReverseProxy's ServeHTTP method,
and incoming server requests are guaranteed to have non-nil bodies.
Still, it's a regression, so fix.
Fixes#12344
Change-Id: Id9a5a47aea3f2875d195b66c9a5f8581c4ca2aed
Reviewed-on: https://go-review.googlesource.com/13935
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>