- 04 Apr, 2016 2 commits
-
-
Rob Pike authored
This makes these names even less likely to collide with a real user-defined function. Fixes #13852. Change-Id: If5a8562c6797ced19c355c7ab2c86fc4401a8674 Reviewed-on: https://go-review.googlesource.com/21490 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
Christopher Nelson authored
Add supporting code for runtime initialization, including both 32- and 64-bit x86 architectures. Add .ctors section on Windows to PE .o files, and INITENTRY to .ctors section to plug in to the GCC C/C++ startup initialization mechanism. This allows the Go runtime to initialize itself. Add .text section symbol for .ctor relocations. Note: This is unlikely to be useful for MSVC-based toolchains. Fixes #13494 Change-Id: I4286a96f70e5f5228acae88eef46e2bed95813f3 Reviewed-on: https://go-review.googlesource.com/18057Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
- 03 Apr, 2016 12 commits
-
-
Brad Fitzpatrick authored
Change-Id: I03621db79637b04982e1f0e7b4268c4ed2db6d22 Reviewed-on: https://go-review.googlesource.com/21484Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Now that cmd/link uses bufio.Reader, take advantage of it. I find this new version easier to reason about. Reduces allocations by 1.1% when linking a basic HTTP server. Numbers are stable with each round measuring using: rm prof.mem; go tool link -o foo -memprofile=prof.mem -memprofilerate=1 foo.a Before: 65.36MB of 74.53MB total (87.70%) Dropped 157 nodes (cum <= 0.37MB) Showing top 10 nodes out of 39 (cum >= 1.47MB) flat flat% sum% cum cum% 21.48MB 28.81% 28.81% 21.48MB 28.81% cmd/link/internal/ld.Linklookup 16.04MB 21.52% 50.33% 16.04MB 21.52% cmd/link/internal/ld.(*objReader).readSlices 4.61MB 6.19% 56.52% 4.61MB 6.19% cmd/link/internal/ld.(*objReader).readSymName 4.51MB 6.05% 62.57% 6.32MB 8.48% cmd/link/internal/ld.writelines 4.50MB 6.03% 68.60% 4.50MB 6.03% cmd/link/internal/ld.Symgrow 4.02MB 5.39% 73.99% 4.02MB 5.39% cmd/link/internal/ld.linknew 3.98MB 5.34% 79.33% 3.98MB 5.34% cmd/link/internal/ld.setaddrplus 2.96MB 3.97% 83.30% 28.78MB 38.62% cmd/link/internal/ld.(*objReader).readRef 1.81MB 2.43% 85.73% 1.81MB 2.43% cmd/link/internal/ld.newcfaoffsetattr 1.47MB 1.97% 87.70% 1.47MB 1.97% cmd/link/internal/ld.(*objReader).readSym After: 64.66MB of 73.87MB total (87.53%) Dropped 156 nodes (cum <= 0.37MB) Showing top 10 nodes out of 40 (cum >= 1.47MB) flat flat% sum% cum cum% 21.48MB 29.08% 29.08% 21.48MB 29.08% cmd/link/internal/ld.Linklookup 16.04MB 21.71% 50.79% 16.04MB 21.71% cmd/link/internal/ld.(*objReader).readSlices 4.51MB 6.10% 56.90% 6.32MB 8.56% cmd/link/internal/ld.writelines 4.50MB 6.09% 62.99% 4.50MB 6.09% cmd/link/internal/ld.Symgrow 4.02MB 5.44% 68.42% 4.02MB 5.44% cmd/link/internal/ld.linknew 3.98MB 5.38% 73.81% 3.98MB 5.38% cmd/link/internal/ld.setaddrplus 3.90MB 5.28% 79.09% 3.90MB 5.28% cmd/link/internal/ld.(*objReader).readSymName 2.96MB 4.01% 83.09% 28.08MB 38.01% cmd/link/internal/ld.(*objReader).readRef 1.81MB 2.45% 85.55% 1.81MB 2.45% cmd/link/internal/ld.newcfaoffsetattr 1.47MB 1.99% 87.53% 1.47MB 1.99% cmd/link/internal/ld.(*objReader).readSym Also tested locally with asserts that that the calculated length is always correct and thus the adjName buf never reallocates. Change-Id: I19e3e8bfa6a12bcd8b5216f6232f42c122e4f80e Reviewed-on: https://go-review.googlesource.com/21481Reviewed-by:
David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Hudson-Doyle authored
Rather than having half a dozen switch statements. Also remove some c2go dregs. Change-Id: I19af5b64f73369126020e15421c34cad5bbcfbf8 Reviewed-on: https://go-review.googlesource.com/21442Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Michael Munday authored
On s390x char is unsigned. We cannot force it to be signed using -fsigned-char (see arm64) because the s390x gccgo API is already public and we need to stick as closely as possible to it to avoid breaking existing projects. In order to match the gccgo API we also force the RawSockaddr.Data and RawSockaddrUnix.Path fields to be signed. This CL adds a post-processing pass (mkpost.go) to mkall.sh in order to export the types of fields in PtraceRegs on s390x without affecting the API on other platforms. The types of these fields match their counterparts in gccgo. mkpost.go also cleans up the Pad_cgo* fields and X_* fields (these fields are not exported by gccgo currently). It could be extended to add build tags on platforms that need them. Change-Id: I66bdf5b86ec98af70baf666989027bb354df9e3e Reviewed-on: https://go-review.googlesource.com/20961Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shahar Kohanim authored
name old secs new secs delta LinkCmdGo 0.52 ± 3% 0.52 ± 7% ~ (p=0.325 n=93+100) name old MaxRSS new MaxRSS delta LinkCmdGo 120k ± 1% 118k ± 4% -1.10% (p=0.000 n=87+96) Change-Id: I967660b8dc6036d28eeea1b6b30f400fadd57b05 Reviewed-on: https://go-review.googlesource.com/21372 Run-TryBot: Shahar Kohanim <skohanim@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Eric Engestrom authored
Signed-off-by:
Eric Engestrom <eric@engestrom.ch> Change-Id: I91873aaebf79bdf1c00d38aacc1a1fb8d79656a7 Reviewed-on: https://go-review.googlesource.com/21433Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
This makes clear that Go's path.Join and filepath.Join are different from the Python os.path.join (and perhaps others). Requested in private mail. Change-Id: Ie5dfad8a57f9baa5cca31246af1fd4dd5b1a64ee Reviewed-on: https://go-review.googlesource.com/20711Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
Supports basic internal linking, external linking and shared library linking. Change-Id: Ic9693dd94df561b0f9df9880009b1e8ab9d59b92 Reviewed-on: https://go-review.googlesource.com/20879 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Michael Hudson-Doyle <michael.hudson@canonical.com>
-
Brad Fitzpatrick authored
And adds missing tests. Fixes #14970 Change-Id: I0dba02603bc245f555498cb5dd3e0a9d87c52353 Reviewed-on: https://go-review.googlesource.com/21467Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
This code made sense before fmt switched to using sync.Pool, but a sync.Pool clears all items on GC, so not reusing something based on size is just a waste of memory. Change-Id: I201312b0ee6c572ff3c0ffaf71e42623a160d23f Reviewed-on: https://go-review.googlesource.com/21480Reviewed-by:
Rob Pike <r@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
Introduces the new relocation variant RV_390_DBL which indicates that the relocation value should be shifted right by 1 (to make it 2-byte aligned). Change-Id: I03fa96b4759ee19330c5298c3720746622fb1a03 Reviewed-on: https://go-review.googlesource.com/20878 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Generated with eg. Passes toolstash -cmp. Change-Id: I3af35191e73a558080f777a4eed93bcec7dfe1f5 Reviewed-on: https://go-review.googlesource.com/21469 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 02 Apr, 2016 7 commits
-
-
Joe Tsai authored
Rather than specifying every field that should be cleared in Reset, it is better to just zero the entire struct and only preserve or set the fields that we actually care about. This ensures that the Header field is reset for the next use. Fixes #15077 Change-Id: I41832e506d2d64c62b700aa1986e7de24a577511 Reviewed-on: https://go-review.googlesource.com/21465 Run-TryBot: Joe Tsai <joetsai@digital-static.net> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Alexandru Moșoi authored
Handle this case: if 0 <= i && i < len(a) { use a[i] } Shaves about 5k from pkg/tools/linux_amd64/*. Change-Id: I6675ff49aa306b0d241b074c5738e448204cd981 Reviewed-on: https://go-review.googlesource.com/21431 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes #13705 Change-Id: I86c60c78ce0394f830f904c9cba83ebbf3efc046 Reviewed-on: https://go-review.googlesource.com/21328 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Joe Tsai authored
Changes made: * Reader.flg is not used anywhere else other than readHeader and does not need to be stored. * Store Reader.digest and Writer.digest as uint32s rather than as a hash.Hash32 and use the crc32.Update function instead. This simplifies initialization logic since the zero value of uint32 is the initial CRC-32 value. There are no performance detriments to doing this since the hash.Hash32 returned by crc32 simply calls crc32.Update as well. * s/[0:/[:/ Consistently use shorter notation for slicing. * s/RFC1952/RFC 1952/ Consistently use RFC notation. Change-Id: I55416a19f4836cbed943adaa3f672538ea5d166d Reviewed-on: https://go-review.googlesource.com/21429Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@digital-static.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Todd Neal authored
The issue was seen when inlining an exported function that contained a fallthrough statement. Fixes #15071 Change-Id: I1e8215ad49d57673dba7e8f8bd2ed8ad290dc452 Reviewed-on: https://go-review.googlesource.com/21452Reviewed-by:
Dave Cheney <dave@cheney.net>
-
Brad Fitzpatrick authored
Updates the syscall generator for patchset 4 of https://golang.org/cl/21388. Updates #14959 Change-Id: Icbd6df489887d3dcc076dfc73d4feb1376abaf8b Reviewed-on: https://go-review.googlesource.com/21428Reviewed-by:
Alex Brainman <alex.brainman@gmail.com>
-
Matthew Dempsky authored
The IsStruct case is meant to handle cases like append(f()) where f's result parameters are something like ([]int, int, int). However, at this point in the compiler we've already rewritten append(f()) into "tmp1, tmp2, tmp3 := f(); append(tmp1, tmp2, tmp3)". As further evidence, the t.Elem() is not a valid method call for a struct type anyway, which would trigger the Fatalf call in Type.Elem if this code was ever hit. Change-Id: Ia066f93df66ee3fadc9a9a0f687be7b5263af163 Reviewed-on: https://go-review.googlesource.com/21427 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 01 Apr, 2016 19 commits
-
-
Brad Fitzpatrick authored
Make sure that for any DLL that Go uses itself, we only look for the DLL in the Windows System32 directory, guarding against DLL preloading attacks. (Unless the Windows version is ancient and LoadLibraryEx is unavailable, in which case the user probably has bigger security problems anyway.) This does not change the behavior of syscall.LoadLibrary or NewLazyDLL if the DLL name is something unused by Go itself. This change also intentionally does not add any new API surface. Instead, x/sys is updated with a LoadLibraryEx function and LazyDLL.Flags in: https://golang.org/cl/21388 Updates #14959 Change-Id: I8d29200559cc19edf8dcf41dbdd39a389cd6aeb9 Reviewed-on: https://go-review.googlesource.com/21140Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Fixes #15061. Change-Id: I71f69f398d1c5f3a884bbd044786f1a5600d0fae Reviewed-on: https://go-review.googlesource.com/21398 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
gorename -from '"cmd/compile/internal/gc".Node.Int' -to 'Int64' Change-Id: I2fe3bf9a26ae6b0600d990d0c981e4b8b53020a4 Reviewed-on: https://go-review.googlesource.com/21426Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Replace isideal(t) with t.IsUntyped(). Replace Istype(t, k) with t.IsKind(k). Replace isnilinter(t) with t.IsEmptyInterface(). Also replace a lot of t.IsKind(TFOO) with t.IsFoo(). Replacements prepared mechanically with gofmt -w -r. Passes toolstash -cmp. Change-Id: Iba48058f3cc863e15af14277b5ff5e729e67e043 Reviewed-on: https://go-review.googlesource.com/21424Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
This removes all access to Type.Bound from outside type.go. Update sinit to make a new type rather than copy and mutate. Update bimport to create a new slice type instead of mutating TDDDFIELD. These are rare, so the extra allocs are nominal. I’m not happy about having a setter, but it appears the most practical route forward at the moment, and it only has a few uses. Passes toolstash -cmp. Change-Id: I174f07c8f336afc656904bde4bdbde4f3ef0db96 Reviewed-on: https://go-review.googlesource.com/21423 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Generated by eg. Passes toolstash -cmp. Change-Id: I7516c211ca9aacf824f74894671dc62d31763b01 Reviewed-on: https://go-review.googlesource.com/21422 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
This eliminates all direct reads of Type.Bound outside type.go. Change-Id: I0a9a72539f8f4c0de7f5e05e1821936bf7db5eb7 Reviewed-on: https://go-review.googlesource.com/21421 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Add AlgKind enum type to represent AFOO values. Add IsComparable, IsRegularMemory, IncomparableField helper methods to codify common higher-level idioms. Passes toolstash -cmp. Change-Id: I54c544953997a8ccc72396b3058897edcbbea392 Reviewed-on: https://go-review.googlesource.com/21420 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Fixes a problem when using the external linker on Solaris. The Solaris external linker still doesn't work due to issue #14957. The problem is, for example, with `go test cmd/objdump`: objdump_test.go:71: go build fmthello.go: exit status 2 # command-line-arguments /var/gcc/iant/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1 Undefined first referenced symbol in file x_cgo_callers /tmp/go-link-355600608/go.o ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status Change-Id: I54917cfd5c288ee77ea25c439489bd2c9124fe73 Reviewed-on: https://go-review.googlesource.com/21392 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
Sebastien Binet authored
This change exposes a facility to create new struct types from a slice of reflect.StructFields. - reflect: first stab at implementing StructOf - reflect: tests for StructOf StructOf creates new struct types in the form of structTypeWithMethods to accomodate the GC (especially the uncommonType.methods slice field.) Creating struct types with embedded interfaces with unexported methods is not supported yet and will panic. Creating struct types with non-ASCII field names or types is not yet supported (see #15064.) Binaries' sizes for linux_amd64: old=tip (0104a31b) old bytes new bytes delta bin/go 9911336 9915456 +0.04% reflect 781704 830048 +6.18% Updates #5748. Updates #15064. Change-Id: I3b8fd4fadd6ce3b1b922e284f0ae72a3a8e3ce44 Reviewed-on: https://go-review.googlesource.com/9251Reviewed-by:
David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
-
Shahar Kohanim authored
Change-Id: I41722ee605ea76a6b52e8a7e1e10f2293cef1a7a Reviewed-on: https://go-review.googlesource.com/21371Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
Alexandru Moșoi authored
There are 5293 loop in the main go repository. A survey of the top most common for loops: 18 for __k__ := 0; i < len(sa.Addr); i++ { 19 for __k__ := 0; ; i++ { 19 for __k__ := 0; i < 16; i++ { 25 for __k__ := 0; i < length; i++ { 30 for __k__ := 0; i < 8; i++ { 49 for __k__ := 0; i < len(s); i++ { 67 for __k__ := 0; i < n; i++ { 376 for __k__ := range __slice__ { 685 for __k__, __v__ := range __slice__ { 2074 for __, __v__ := range __slice__ { The algorithm to find induction variables handles all cases with an upper limit. It currently doesn't find related induction variables such as c * ind or c + ind. 842 out of 22954 bound checks are removed for src/make.bash. 1957 out of 42952 bounds checks are removed for src/all.bash. Things to do in follow-up CLs: * Find the associated pointer for `for _, v := range a {}` * Drop the NilChecks on the pointer. * Replace the implicit induction variable by a loop over the pointer Generated garbage can be reduced if we share the sdom between passes. % benchstat old.txt new.txt name old time/op new time/op delta Template 337ms ± 3% 333ms ± 3% ~ (p=0.258 n=9+9) GoTypes 1.11s ± 2% 1.10s ± 2% ~ (p=0.912 n=10+10) Compiler 5.25s ± 1% 5.29s ± 2% ~ (p=0.077 n=9+9) MakeBash 33.5s ± 1% 34.1s ± 2% +1.85% (p=0.011 n=9+9) name old alloc/op new alloc/op delta Template 63.6MB ± 0% 63.9MB ± 0% +0.52% (p=0.000 n=10+9) GoTypes 218MB ± 0% 219MB ± 0% +0.59% (p=0.000 n=10+9) Compiler 978MB ± 0% 985MB ± 0% +0.69% (p=0.000 n=10+10) name old allocs/op new allocs/op delta Template 582k ± 0% 583k ± 0% +0.10% (p=0.000 n=10+10) GoTypes 1.78M ± 0% 1.78M ± 0% +0.12% (p=0.000 n=10+10) Compiler 7.68M ± 0% 7.69M ± 0% +0.05% (p=0.000 n=10+10) name old text-bytes new text-bytes delta HelloSize 581k ± 0% 581k ± 0% -0.08% (p=0.000 n=10+10) CmdGoSize 6.40M ± 0% 6.39M ± 0% -0.08% (p=0.000 n=10+10) name old data-bytes new data-bytes delta HelloSize 3.66k ± 0% 3.66k ± 0% ~ (all samples are equal) CmdGoSize 134k ± 0% 134k ± 0% ~ (all samples are equal) name old bss-bytes new bss-bytes delta HelloSize 126k ± 0% 126k ± 0% ~ (all samples are equal) CmdGoSize 149k ± 0% 149k ± 0% ~ (all samples are equal) name old exe-bytes new exe-bytes delta HelloSize 947k ± 0% 946k ± 0% -0.01% (p=0.000 n=10+10) CmdGoSize 9.92M ± 0% 9.91M ± 0% -0.06% (p=0.000 n=10+10) Change-Id: Ie74bdff46fd602db41bb457333d3a762a0c3dc4d Reviewed-on: https://go-review.googlesource.com/20517Reviewed-by:
David Chase <drchase@google.com> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
-
Ian Lance Taylor authored
The new function runtime.SetCgoTraceback may be used to register stack traceback and symbolizer functions, written in C, to do a stack traceback from cgo code. There is a sample implementation of runtime.SetCgoSymbolizer at github.com/ianlancetaylor/cgosymbolizer. Just importing that package is sufficient to get symbolic C backtraces. Currently only supported on linux/amd64. Change-Id: If96ee2eb41c6c7379d407b9561b87557bfe47341 Reviewed-on: https://go-review.googlesource.com/17761Reviewed-by:
Austin Clements <austin@google.com>
-
David Chase authored
Added a debug flag "-d closure" to explain compilation of closures (should this be done some other way? Should we rewrite the "-m" flag to "-d escapes"?) Used this to discover that cause was an OXXX node in the captured vars list, and in turn noticed that OXXX nodes are explicitly ignored in all other processing of captured variables. Couldn't figure out a reproducer, did verify that this OXXX was not caused by an unnamed return value (which is one use of these). Verified lack of heap allocation by examining -S output. Assembly: (runtime/mgc.go:1371) PCDATA $0, $2 (runtime/mgc.go:1371) CALL "".notewakeup(SB) (runtime/mgc.go:1377) LEAQ "".gcBgMarkWorker.func1·f(SB), AX (runtime/mgc.go:1404) MOVQ AX, (SP) (runtime/mgc.go:1404) MOVQ "".autotmp_2242+88(SP), CX (runtime/mgc.go:1404) MOVQ CX, 8(SP) (runtime/mgc.go:1404) LEAQ go.string."GC worker (idle)"(SB), AX (runtime/mgc.go:1404) MOVQ AX, 16(SP) (runtime/mgc.go:1404) MOVQ $16, 24(SP) (runtime/mgc.go:1404) MOVB $20, 32(SP) (runtime/mgc.go:1404) MOVQ $0, 40(SP) (runtime/mgc.go:1404) PCDATA $0, $2 (runtime/mgc.go:1404) CALL "".gopark(SB) Added a check for compiling_runtime to ensure that this is caught in the future. Added a test to test the check. Verified that 1.5.3 did NOT reject the test case when compiled with -+ flag, so this is not a recently added bug. Cause of bug is two-part -- there was no leaking closure detection ever, and instead it relied on capture-of-variables to trigger compiling_runtime test, but closures improved in 1.5.3 so that mere capture of a value did not also capture the variable, which thus allowed closures to escape, as well as this case where the escape was spurious. In fixedbugs/issue14999.go, compare messages for f and g; 1.5.3 would reject g, but not f. 1.4 rejects both because 1.4 heap-allocates parameter x for both. Fixes #14999. Change-Id: I40bcdd27056810628e96763a44f2acddd503aee1 Reviewed-on: https://go-review.googlesource.com/21322 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
Dominik Honnef authored
Change-Id: Iba82a5bd3846f7ab038cc10ec72ff6bcd2c0b484 Reviewed-on: https://go-review.googlesource.com/21377 Run-TryBot: Dave Cheney <dave@cheney.net> Reviewed-by:
Dave Cheney <dave@cheney.net>
-
Dave Cheney authored
Fix build error on darwin/{arm,arm64} caused by a62ae9f6. Change-Id: I7da4d147a529b11b3e71352a9276a57595ec4b05 Reviewed-on: https://go-review.googlesource.com/21356 Run-TryBot: Dave Cheney <dave@cheney.net> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Also cleans up return parameter stutter and missing periods. Change-Id: I47f5c230227ddfd1b105d5e06842f89ffea50760 Reviewed-on: https://go-review.googlesource.com/21362Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
Brad Fitzpatrick authored
Issue #8633 (and #9134) noted that we didn't document the rules about closing the Response.Body when Client.Do returned both a non-nil *Response and a non-nil error (which can only happen when the user's CheckRedirect returns an error). In the process of investigating, I cleaned this code up a bunch, but no user-visible behavior should have changed, except perhaps some better error messages in some cases. It turns out it's always been the case that when a CheckRedirect error occurs, the Response.Body is already closed. Document that. And the new code makes that more obvious too. Fixes #8633 Change-Id: Ibc40cc786ad7fc4e0cf470d66bb559c3b931684d Reviewed-on: https://go-review.googlesource.com/21364 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
Ian Lance Taylor authored
The change in 20907 fixed varexpr but broke aliased. After that change, a reference to a field in a struct would not be seen as aliasing itself. Before that change, it would, but only because all fields in a struct aliased everything. This CL changes the compiler to consider all references to a field as aliasing all other fields in that struct. This is imperfect--a reference to one field does not alias another field--but is a simple fix for the immediate problem. A better fix would require tracking the specific fields as well. Fixes #15042. Change-Id: I5c95c0dd7b0699e53022fce9bae2e8f50d6d1d04 Reviewed-on: https://go-review.googlesource.com/21390 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Matthew Dempsky <mdempsky@google.com>
-