Commit graph

24094 commits

Author SHA1 Message Date
Josh Bleecher Snyder ffbf209a7c [dev.ssa] test: gofmt {goto,label,label1}.go
Change-Id: I971d0c93632e39aad4e2ba1862f085df820baf8b
Reviewed-on: https://go-review.googlesource.com/12431
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-20 20:09:34 +00:00
Josh Bleecher Snyder f421735bb4 [dev.ssa] cmd/compile: handle OpCopy loops in rewrite
Change-Id: Icbaad6e5cbfc5430a651538fe90c0a9ee664faf4
Reviewed-on: https://go-review.googlesource.com/12360
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-20 17:35:08 +00:00
Keith Randall c1593da817 [dev.ssa] cmd/compile/internal/ssa/gen: Fix *64 strength reduction
*64 is <<6, not <<5.

Change-Id: I2eb7e113d5003b2c77fbd3abc3defc4d98976a5e
Reviewed-on: https://go-review.googlesource.com/12323
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-17 15:59:10 +00:00
Keith Randall 3dcc424be7 [dev.ssa] cmd/compile/internal/ssa: compute outarg size correctly
Keep track of the outargs size needed at each call.
Compute the size of the outargs section of the stack frame.  It's just
the max of the outargs size at all the callsites in the function.

Change-Id: I3d0640f654f01307633b1a5f75bab16e211ea6c0
Reviewed-on: https://go-review.googlesource.com/12178
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-16 21:06:13 +00:00
Josh Bleecher Snyder 8adc905a10 [dev.ssa] cmd/compile: implement lowering of constant bools
Change-Id: Ia56ee9798eefe123d4da04138a6a559d2c25ddf3
Reviewed-on: https://go-review.googlesource.com/12312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-16 19:28:45 +00:00
Josh Bleecher Snyder 766bcc92a5 [dev.ssa] cmd/compile: don't Compile if Unimplemented
If we've already hit an Unimplemented, there may be important
SSA invariants that do not hold and which could cause
ssa.Compile to hang or spin.

While we're here, make detected dependency cycles stop execution.

Change-Id: Ic7d4eea659e1fe3f2c9b3e8a4eee5567494f46ad
Reviewed-on: https://go-review.googlesource.com/12310
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-16 18:54:09 +00:00
Keith Randall cd7e059496 [dev.ssa] cmd/compile/internal/ssa: implement ODOT
Implement ODOT.  Similar to ArrayIndex, StructSelect selects a field
out of a larger Value.

We may need more ways to rewrite StructSelect, but StructSelect/Load
is the typical way it is used.

Change-Id: Ida7b8aab3298f4754eaf9fee733974cf8736e45d
Reviewed-on: https://go-review.googlesource.com/12265
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-16 05:43:36 +00:00
Todd Neal 078ba138d3 [dev.ssa] cmd/compile/internal : Implement Lengauer-Tarjan for dominators
Implements the simple Lengauer-Tarjan algorithm for dominator
and post-dominator calculation.

benchmark                           old ns/op     new ns/op     delta
BenchmarkDominatorsLinear-8         1403862       1292741       -7.92%
BenchmarkDominatorsFwdBack-8        1270633       1428285       +12.41%
BenchmarkDominatorsManyPred-8       225932354     1530886       -99.32%
BenchmarkDominatorsMaxPred-8        445994225     1393612       -99.69%
BenchmarkDominatorsMaxPredVal-8     447235248     1246899       -99.72%
BenchmarkNilCheckDeep1-8            829           1259          +51.87%
BenchmarkNilCheckDeep10-8           2199          2397          +9.00%
BenchmarkNilCheckDeep100-8          57325         29405         -48.70%
BenchmarkNilCheckDeep1000-8         6625837       2933151       -55.73%
BenchmarkNilCheckDeep10000-8        763559787     319105541     -58.21%

benchmark                           old MB/s     new MB/s     speedup
BenchmarkDominatorsLinear-8         7.12         7.74         1.09x
BenchmarkDominatorsFwdBack-8        7.87         7.00         0.89x
BenchmarkDominatorsManyPred-8       0.04         6.53         163.25x
BenchmarkDominatorsMaxPred-8        0.02         7.18         359.00x
BenchmarkDominatorsMaxPredVal-8     0.02         8.02         401.00x
BenchmarkNilCheckDeep1-8            1.21         0.79         0.65x
BenchmarkNilCheckDeep10-8           4.55         4.17         0.92x
BenchmarkNilCheckDeep100-8          1.74         3.40         1.95x
BenchmarkNilCheckDeep1000-8         0.15         0.34         2.27x
BenchmarkNilCheckDeep10000-8        0.01         0.03         3.00x

Change-Id: Icec3d774422a9bc64914779804c8c0ab73aa72bf
Reviewed-on: https://go-review.googlesource.com/11971
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-15 16:17:04 +00:00
Todd Neal b383de2ef9 [dev.ssa] cmd/compile: implement OIND
Change-Id: I15aee8095e6388822e2222f1995fe2278ac956ca
Reviewed-on: https://go-review.googlesource.com/12129
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-15 03:24:05 +00:00
Keith Randall 4e204b42f5 [dev.ssa] cmd/compile/internal/ssa: ensure Phi ops are scheduled first
Phi ops should always be scheduled first.  They have the semantics
of all happening simultaneously at the start of the block.  The regalloc
phase assumes all the phis will appear first.

Change-Id: I30291e1fa384a0819205218f1d1ec3aef6d538dd
Reviewed-on: https://go-review.googlesource.com/12154
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-14 15:39:56 +00:00
Brad Fitzpatrick 337b7e7e3b [dev.ssa] cmd/compile: handle OLITERAL nil expressions
Change-Id: I02b8fb277b486eaf0916ddcd8f28c062d4022d4b
Reviewed-on: https://go-review.googlesource.com/12150
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-14 00:07:31 +00:00
Keith Randall c3c84a2544 [dev.ssa] cmd/compile/internal/gc: Implement ODOT and ODOTPTR in addr.
Change-Id: If8a9d5901fa2141d16b1c8d001761ea62bc23207
Reviewed-on: https://go-review.googlesource.com/12141
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-13 23:17:08 +00:00
Brad Fitzpatrick b06961b4f0 [dev.ssa] cmd/compile: treat unsafe.Pointer as a pointer
Change-Id: I3f3ac3055c93858894b8852603d79592bbc1696b
Reviewed-on: https://go-review.googlesource.com/12140
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-13 22:36:24 +00:00
Brad Fitzpatrick a92bd66282 [dev.ssa] cmd/compile: support zero type for *T
Change-Id: I4c9bcea01e2c4333c2a3592b66f1da9f424747a4
Reviewed-on: https://go-review.googlesource.com/12130
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-13 21:29:01 +00:00
Brad Fitzpatrick 50e59bb9c8 [dev.ssa] cmd/compile/internal/gc: fix tests on non-amd64
Change-Id: Ibd6a59db2d5feea41a21fbea5c1a7fdd49238aa8
Reviewed-on: https://go-review.googlesource.com/12131
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-13 21:27:44 +00:00
Brad Fitzpatrick e81671115c [dev.ssa] cmd/compile: OANDAND, OOROR
Joint hacking with josharian. Hints from matloob and Todd Neal.

Now with tests, and OROR.

Change-Id: Iff8826fde475691fb72a3eea7396a640b6274af9
Reviewed-on: https://go-review.googlesource.com/12041
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-13 04:08:16 +00:00
Keith Randall 7e4c06dad0 [dev.ssa] cmd/compile/internal/gc: handle _ label correctly
An empty label statement can just be ignored, as it cannot
be the target of any gotos.

Tests are already in test/fixedbugs/issue7538*.go

Fixes #11589
Fixes #11593

Change-Id: Iadcd639e7200ce16aa40fd7fa3eaf82522513e82
Reviewed-on: https://go-review.googlesource.com/12093
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-12 20:43:01 +00:00
Daniel Morsing 4c521ac8f2 [dev.ssa] cmd/compile/internal/gc: implement more no-op statements
Change-Id: I26c268f46dcffe39912b8c92ce9abb875310934f
Reviewed-on: https://go-review.googlesource.com/12100
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-12 16:55:31 +00:00
Keith Randall accf9b5951 [dev.ssa] cmd/compile/internal/ssa: comment why replacing phi with copy is ok
Change-Id: I3e2e8862f2fde4349923016b97e8330b0d494e0e
Reviewed-on: https://go-review.googlesource.com/12092
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-12 04:39:44 +00:00
Brad Fitzpatrick d9c72d739c [dev.ssa] cmd/compile: implement ONOT
Co-hacking with josharian at Gophercon.

Change-Id: Ia59dfab676c6ed598c2c25483439cd1395a4ea87
Reviewed-on: https://go-review.googlesource.com/12029
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-12 04:30:03 +00:00
Brad Fitzpatrick 7af53d98cf [dev.ssa] cmd/compile: implement OCAP
And dependent fixes and misc cleanup.

Co-hacking with josharian at Gophercon.

Change-Id: Ib85dc13b303929017eb0a4d2fc2f603485f7479b
Reviewed-on: https://go-review.googlesource.com/12027
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-12 04:14:58 +00:00
Keith Randall 050ce4390a [dev.ssa] cmd/compile/internal/ssa: Phi inputs from dead blocks are not live
Fixes #11676

Change-Id: I941f951633c89bb1454ce6d1d1b4124d46a7d9dd
Reviewed-on: https://go-review.googlesource.com/12091
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-11 22:45:14 +00:00
ALTree 7a982e3c49 [dev.ssa] cmd/compile/ssa: Replace less-or-equal with equal in len comparison with zero
Since the spec guarantees than 0 <= len always:

https://golang.org/ref/spec#Length_and_capacity

replace len(...) <= 0 check with len(...) == 0 check

Change-Id: I5517a9cb6b190f0b1ee314a67487477435f3b409
Reviewed-on: https://go-review.googlesource.com/12034
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-11 19:38:57 +00:00
Keith Randall 06f329220f [dev.ssa] cmd/compile/internal/ssa: Use Ninit from expressions
If an expression has an Ninit list, generate code for it.
Required for (at least) OANDAND.

Change-Id: I94c9e22e2a76955736f4a8e574d92711419c5e5c
Reviewed-on: https://go-review.googlesource.com/12072
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-11 19:32:35 +00:00
Josh Bleecher Snyder 9b048527db [dev.ssa] cmd/compile/ssa: handle nested dead blocks
removePredecessor can change which blocks are live.
However, it cannot remove dead blocks from the function's
slice of blocks because removePredecessor may have been
called from within a function doing a walk of the blocks.

CL 11879 did not handle this correctly and broke the build.

To fix this, mark the block as dead but leave its actual
removal for a deadcode pass. Blocks that are dead must have
no successors, predecessors, values, or control values,
so they will generally be ignored by other passes.
To be safe, we add a deadcode pass after the opt pass,
which is the only other pass that calls removePredecessor.

Two alternatives that I considered and discarded:

(1) Make all call sites aware of the fact that removePrecessor
might make arbitrary changes to the list of blocks. This
will needlessly complicate callers.

(2) Handle the things that can go wrong in practice when
we encounter a dead-but-not-removed block. CL 11930 takes
this approach (and the tests are stolen from that CL).
However, this is just patching over the problem.

Change-Id: Icf0687b0a8148ce5e96b2988b668804411b05bd8
Reviewed-on: https://go-review.googlesource.com/12004
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: Michael Matloob <michaelmatloob@gmail.com>
2015-07-11 00:08:50 +00:00
Josh Bleecher Snyder 9201c86b57 [dev.ssa] cmd/compile/ssa: print lazily
Reduces 'go run run.go 64bit.go' from 23s to 8s on my machine.

Change-Id: Ie5b642d0abb56e8eb3899d69472bc88a85a1c985
Reviewed-on: https://go-review.googlesource.com/12023
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-11 00:07:52 +00:00
Josh Bleecher Snyder 5173868325 [dev.ssa] cmd/compile/ssa: place for loop incr in a separate block
This is a prerequisite for implementing break and continue;
blocks ending in break or continue need to have
the increment block as a successor.

While we're here, implement for loops with no condition.

Change-Id: I85d8ba020628d805bfd0bd583dfd16e1be6f6fae
Reviewed-on: https://go-review.googlesource.com/11941
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-10 03:39:20 +00:00
Todd Neal 41dafe6ecc [dev.ssa] cmd/compile/ssa: dominator tests and benchmarks
This change has some tests verifying functionality and an assortment of
benchmarks of various block lists. It modifies NewBlock to allocate in
contiguous blocks improving the performance of intersect() for extremely
large graphs by 30-40%.

benchmark                           old ns/op      new ns/op     delta
BenchmarkDominatorsLinear-8         1185619        901154        -23.99%
BenchmarkDominatorsFwdBack-8        1302138        863537        -33.68%
BenchmarkDominatorsManyPred-8       404670521      247450911     -38.85%
BenchmarkDominatorsMaxPred-8        455809002      471675119     +3.48%
BenchmarkDominatorsMaxPredVal-8     819315864      468257300     -42.85%

BenchmarkNilCheckDeep1-8            766            706           -7.83%
BenchmarkNilCheckDeep10-8           2553           2209          -13.47%
BenchmarkNilCheckDeep100-8          58606          57545         -1.81%
BenchmarkNilCheckDeep1000-8         7753012        8025750       +3.52%
BenchmarkNilCheckDeep10000-8        1224165946     789995184     -35.47%

Change-Id: Id3d6bc9cb1138e8177934441073ac7873ddf7ade
Reviewed-on: https://go-review.googlesource.com/11716
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-07 19:42:35 +00:00
Josh Bleecher Snyder 7d10a2c04a [dev.ssa] cmd/compile/ssa: implement constant booleans
The removal of if false { ... } blocks in the opt
pass exposed that removePredecessor needed
to do more cleaning, on pain of failing later
consistency checks.

Change-Id: I45d4ff7e1f7f1486fdd99f867867ce6ea006a288
Reviewed-on: https://go-review.googlesource.com/11879
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-06 21:54:10 +00:00
Josh Bleecher Snyder cc3f031a31 [dev.ssa] cmd/compile/ssa: implement OLEN
Change-Id: Ie23b13142fd820d7071a348a8370175e58b76d64
Reviewed-on: https://go-review.googlesource.com/11878
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-05 03:52:56 +00:00
Josh Bleecher Snyder 6c14059e65 [dev.ssa] cmd/compile/ssa: handle loops that don't loop
Loops such as

func f(c chan int) int {
	for x := range c {
		return x
	}
	return 0
}

don't loop. Remove the assumption that they must.

Partly fixes the build.

Change-Id: I766cebeec8e36d14512bea26f54c06c8eaf95e23
Reviewed-on: https://go-review.googlesource.com/11876
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-05 03:52:34 +00:00
Josh Bleecher Snyder d465f049cd [dev.ssa] cmd/compile/ssa: stop compilation immediately on leading goto
There is clearly work to do to fix labels and gotos.
The compiler currently hangs on ken/label.go.

For the moment, stop the bleeding.

Fixes the build.

Change-Id: Ib68360d583cf53e1a8ca4acff50644b570382728
Reviewed-on: https://go-review.googlesource.com/11877
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-05 03:51:44 +00:00
Josh Bleecher Snyder 0a133cddd5 [dev.ssa] cmd/compile/ssa: mark race/nodfp as unimplemented
Partly fixes the build, by punting.
Other things have broken in the meantime.

Change-Id: I1e2b8310057cbbbd9ffc501ef51e744690e00726
Reviewed-on: https://go-review.googlesource.com/11875
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-05 03:50:17 +00:00
Josh Bleecher Snyder 1edf4897df [dev.ssa] cmd/compile/ssa: add Logf state helper
Change-Id: I4e4200b0fa847a1ff8a8b7d1e318bbc1c5e26b5b
Reviewed-on: https://go-review.googlesource.com/11874
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-05 03:36:56 +00:00
Daniel Morsing be2a3e2ac9 [dev.ssa] cmd/compile/internal/gc: mark unimplemented variable classes as such
Doesn't fix the build entirely, but does make it get to the race
detector tests.

Change-Id: Ie986d52374936855b7ee975dc68742306527eb15
Reviewed-on: https://go-review.googlesource.com/11835
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-02 08:29:33 +00:00
Josh Bleecher Snyder 596ddf4368 [dev.ssa] cmd/compile/ssa: add checks for nil args in values
These additional checks were useful in
tracking down the broken build (CL 11238).

This CL does not fix the build, sadly.

Change-Id: I34de3bed223f450aaa97c1cadaba2e4e5850050b
Reviewed-on: https://go-review.googlesource.com/11681
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-01 16:10:38 +00:00
Daniel Morsing 66b47812eb [dev.ssa] cmd/compile/internal/ssa: Initial implementation of memory zeroing
This will make it possible for us to start implementing interfaces
and other stack allocated types which are more than one machine word.

Change-Id: I52b187a791cf1919cb70ed6dabdc9f57b317ea83
Reviewed-on: https://go-review.googlesource.com/11631
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-01 15:47:41 +00:00
Keith Randall c9372619f2 [dev.ssa] cmd/compile/internal/gc: fix stringsym call
Forgot to add this in the tip merge.

Change-Id: I0e5a2681133f4ae7a7c360ae2c2d71d46420c693
Reviewed-on: https://go-review.googlesource.com/11793
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-01 04:18:52 +00:00
Keith Randall 90b0a93244 [dev.ssa] Merge remote-tracking branch 'origin/master' into ssamerge
Semi-regular merge from tip into ssa branch.

Change-Id: I9cbe23f566410496d4ceb97c1435e2df7f2b56ec
2015-06-30 21:11:33 -07:00
Rob Pike 6fe9c4a7bd doc: more library in go1.5.html
Everything in the library but crypto and net.

Change-Id: I89b21b9621e6d338fa1891da0eabba5d7d2fe349
Reviewed-on: https://go-review.googlesource.com/11820
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-01 02:25:39 +00:00
Brad Fitzpatrick fc2eee87ed database/sql: make Register safe for concurrent use
Adding a mutex was easier than documenting it, and is consistent with
gob.

Fixes #9847

Change-Id: Ifa94c17e7c11643add81b35431ef840b794d78b1
Reviewed-on: https://go-review.googlesource.com/11682
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-30 23:15:03 +00:00
Brad Fitzpatrick 300d9a2158 net/http: harden Server against request smuggling
See RFC 7230.

Thanks to Régis Leroy for the report.

Change-Id: Ic1779bc2180900430d4d7a4938cac04ed73c304c
Reviewed-on: https://go-review.googlesource.com/11810
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-30 22:56:30 +00:00
Brad Fitzpatrick 2714005a24 internal/singleflight: deflake test
Fixes #11475

Change-Id: Ibaedbb732bb1b9f062bd5af7b866ec4758c724a7
Reviewed-on: https://go-review.googlesource.com/11770
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-30 22:55:59 +00:00
Alan Donovan f11109fbc9 go/types: change {Type,Object,Selection}String to accept a Qualifier function
The optional Qualifier function determines what prefix to attach to
package-level names, enabling clients to qualify packages in different
ways, for example, using only the package name instead of its complete
path, or using the locally appropriate name for package given a set of
(possibly renaming) imports.

Prior to this change, clients wanting this behavior had to copy
hundreds of lines of complex printing logic.

Fun fact: (*types.Package).Path and (*types.Package).Name are valid
Qualifier functions.

We provide the RelativeTo helper function to create Qualifiers so that
the old behavior remains a one-liner.

Fixes golang/go#11133

This CL is a copy of https://go-review.googlesource.com/#/c/11692/
to the golang.org/x/tools repository.

Change-Id: I26d0f3644d077a26bfe350989f9c545f018eefbf
Reviewed-on: https://go-review.googlesource.com/11790
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
2015-06-30 21:44:42 +00:00
Russ Cox 6f80e5edf4 cmd/link: reject data size > 2 GB
We can't address more than this on amd64 anyway.

Fixes #9862.

Change-Id: Ifb1abae558e2e1ee2dc953a76995f3f08c60b1df
Reviewed-on: https://go-review.googlesource.com/11715
Reviewed-by: Austin Clements <austin@google.com>
2015-06-30 19:40:39 +00:00
Russ Cox e8f2eb4349 cmd/compile: allow linker to drop string headers when not needed
Compiling a simple file containing a slice of 100,000 strings,
the size of the resulting binary dropped from 5,896,224 bytes
to 3,495,968 bytes, which is the expected 2,400,000 bytes,
give or take.

Fixes #7384.

Change-Id: I3e551b5a1395b523a41b33518d81a1bf28da0906
Reviewed-on: https://go-review.googlesource.com/11698
Reviewed-by: Austin Clements <austin@google.com>
2015-06-30 19:27:52 +00:00
Russ Cox 3b6e86f48a cmd/compile: fix race detector handling of OBLOCK nodes
Fixes #7561 correctly.
Fixes #9137.

Change-Id: I7f27e199d7101b785a7645f789e8fe41a405a86f
Reviewed-on: https://go-review.googlesource.com/11713
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2015-06-30 19:25:18 +00:00
Brad Fitzpatrick 117ddcb83d net/textproto: don't treat spaces as hyphens in header keys
This was originally done in https://codereview.appspot.com/5690059
(Feb 2012) to deal with bad response headers coming back from webcams,
but it presents a potential security problem with HTTP request
smuggling for request headers containing "Content Length" instead of
"Content-Length".

Part of overall HTTP hardening for request smuggling. See RFC 7230.

Thanks to Régis Leroy for the report.

Change-Id: I92b17fb637c9171c5774ea1437979ae2c17ca88a
Reviewed-on: https://go-review.googlesource.com/11772
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-30 17:59:02 +00:00
Dmitry Vyukov 8884fa7476 cmd/trace: sort procs
If you have more than 10 procs, then currently they are sorted alphabetically as
0, 10, 11, ..., 19, 2, 20, ...
Assign explicit order to procs so that they are sorted numerically.

Change-Id: I6d978d2cd439aa2fcbcf147842a643f9073eef75
Reviewed-on: https://go-review.googlesource.com/11750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-30 16:50:57 +00:00
Brad Fitzpatrick 9462bcedc6 net/http: harden, document func SetCookie and type Cookie
Fixes #9758

Change-Id: I3089ec06cddd74b547d8b10834d7478a04b02069
Reviewed-on: https://go-review.googlesource.com/11701
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-30 16:19:02 +00:00