1. 03 Nov, 2016 24 commits
  2. 02 Nov, 2016 16 commits
    • Robert Griesemer's avatar
      go/types: set up correct type with NewAlias · 627f4d85
      Robert Griesemer authored
      Change-Id: I4b035b3539c98e5b1442d1009d457cbc199b42ee
      Reviewed-on: https://go-review.googlesource.com/32637Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      627f4d85
    • Michael Munday's avatar
      cmd/vet: add test case for ppc64{,le} · 5513f855
      Michael Munday authored
      Adapted from the mips64 test case.
      
      Fixes #17745.
      
      Change-Id: I46f0900028adb936dcab2cdc701ea11d0a3cb95e
      Reviewed-on: https://go-review.googlesource.com/32611
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      5513f855
    • Keith Randall's avatar
      cmd/compile: compute faulting args before writing args to stack · cf28e5cc
      Keith Randall authored
      when compiling f(a, b, c), we do something like:
        *(SP+0) = eval(a)
        *(SP+8) = eval(b)
        *(SP+16) = eval(c)
        call f
      
      If one of those evaluations is later determined to unconditionally panic
      (say eval(b) in this example), then the call is deadcode eliminated. But
      any previous argument write (*(SP+0)=... here) is still around. Becuase
      we only compute the size of the outarg area for calls which are still
      around at the end of optimization, the space needed for *(SP+0)=v is not
      accounted for and thus the outarg area may be too small.
      
      The fix is to make sure that we evaluate any potentially panicing
      operation before we write any of the args to the stack. It turns out
      that fix is pretty easy, as we already have such a mechanism available
      for function args. We just need to extend it to possibly panicing args
      as well.
      
      The resulting code (if b and c can panic, but a can't) is:
        tmpb = eval(b)
        *(SP+16) = eval(c)
        *(SP+0) = eval(a)
        *(SP+8) = tmpb
        call f
      
      This change tickled a bug in how we find the arguments for intrinsic
      calls, so that latent bug is fixed up as well.
      
      Update #16760.
      
      Change-Id: I0bf5edf370220f82bc036cf2085ecc24f356d166
      Reviewed-on: https://go-review.googlesource.com/32551Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      cf28e5cc
    • Keith Randall's avatar
      cmd/compile: do more type conversion inline · 688995d1
      Keith Randall authored
      The code to do the conversion is smaller than the
      call to the runtime.
      The 1-result asserts need to call panic if they fail, but that
      code is out of line.
      
      The only conversions left in the runtime are those which
      might allocate and those which might need to generate an itab.
      
      Given the following types:
        type E interface{}
        type I interface { foo() }
        type I2 iterface { foo(); bar() }
        type Big [10]int
        func (b Big) foo() { ... }
      
      This CL inlines the following conversions:
      
      was assertE2T
        var e E = ...
        b := i.(Big)
      was assertE2T2
        var e E = ...
        b, ok := i.(Big)
      was assertI2T
        var i I = ...
        b := i.(Big)
      was assertI2T2
        var i I = ...
        b, ok := i.(Big)
      was assertI2E
        var i I = ...
        e := i.(E)
      was assertI2E2
        var i I = ...
        e, ok := i.(E)
      
      These are the remaining runtime calls:
      
      convT2E:
        var b Big = ...
        var e E = b
      convT2I:
        var b Big = ...
        var i I = b
      convI2I:
        var i2 I2 = ...
        var i I = i2
      assertE2I:
        var e E = ...
        i := e.(I)
      assertE2I2:
        var e E = ...
        i, ok := e.(I)
      assertI2I:
        var i I = ...
        i2 := i.(I2)
      assertI2I2:
        var i I = ...
        i2, ok := i.(I2)
      
      Fixes #17405
      Fixes #8422
      
      Change-Id: Ida2367bf8ce3cd2c6bb599a1814f1d275afabe21
      Reviewed-on: https://go-review.googlesource.com/32313
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      688995d1
    • Keith Randall's avatar
      cmd/compile: On a runtime.KeepAlive call, keep whole variable alive · 761443ed
      Keith Randall authored
      We generate an OpKeepAlive for the idata portion of the interface
      for a runtime.KeepAlive call.  But given such an op, we need to keep
      the entire containing variable alive, not just the range that was
      passed to the OpKeepAlive operation.
      
      Fixes #17710
      
      Change-Id: I90de66ec8065e22fb09bcf9722999ddda289ae6e
      Reviewed-on: https://go-review.googlesource.com/32477
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarJoe Tsai <thebrokentoaster@gmail.com>
      761443ed
    • Brad Fitzpatrick's avatar
      net/http: update bundled http2 · 09bb6434
      Brad Fitzpatrick authored
      Update bundled x/net/http2 to x/net git rev 6c4ac8bd for:
      
         http2: fix Transport race sending RST_STREAM while reading DATA on cancels
         https://golang.org/cl/32571
      
         http2: remove h2-14 ALPN proto
         https://golang.org/cl/32576
      
      Fixes #16974
      
      Change-Id: I6ff8493a13d2641499fedf33e8005004735352ff
      Reviewed-on: https://go-review.googlesource.com/32578
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      09bb6434
    • Joe Tsai's avatar
      archive/tar: disable prefix field in Writer · 2d3cd51d
      Joe Tsai authored
      The proper fix for the Writer is too involved to be done in time
      for Go 1.8. Instead, we do a localized fix that simply disables the
      prefix encoding logic. While this will prevent some legitimate uses
      of prefix, it will ensure that we don't keep outputting invalid
      GNU format files that have the prefix field populated.
      
      For headers with long filenames that could have used the prefix field,
      they will be promoted to use the PAX format, which ensures that we
      will still be able to encode all headers that we were able to do before.
      
      Updates #12594
      Fixes #17630
      Fixes #9683
      
      Change-Id: Ia97b524ac69865390e2ae8bb0dfb664d40a05add
      Reviewed-on: https://go-review.googlesource.com/32234Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2d3cd51d
    • Michael Munday's avatar
      cmd/vet: fix go vet on s390x assembly · eed2bb71
      Michael Munday authored
      Test adapted from the mips64 test.
      
      Fixes #15454.
      
      Change-Id: If890c2d18a4a03a08faaa2e674edd7223af60290
      Reviewed-on: https://go-review.googlesource.com/22472
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      eed2bb71
    • Matthew Dempsky's avatar
      cmd/compile: avoid double export of aliased objects · bcc02473
      Matthew Dempsky authored
      Instead of writing out the original object for each alias, ensure we
      export the original object before any aliases. This allows the aliases
      to simply refer back to the original object by qualified name.
      
      Fixes #17636.
      
      Change-Id: If80fa8c66b8fee8344a00b55d25a8aef22abd859
      Reviewed-on: https://go-review.googlesource.com/32575
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      bcc02473
    • Russ Cox's avatar
      net: fix Dial(":80") on Windows · 1a0b1cca
      Russ Cox authored
      Windows sockets allow bind to 0.0.0.0:80 but not connect to it.
      To make Listen(":80") / Dial(":80") work as documented on Windows,
      connect to 127.0.0.1 or ::1 (depending on network) in place of 0.0.0.0.
      
      Fixes #6290.
      
      Change-Id: Ia27537067276871648546678fbe0f1b8478329fe
      Reviewed-on: https://go-review.googlesource.com/32101
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMikio Hara <mikioh.mikioh@gmail.com>
      1a0b1cca
    • Russ Cox's avatar
      testing: introduce testing/internal/testdeps for holding testmain dependencies · c56cc9b3
      Russ Cox authored
      Currently, we don't have package testing to import package regexp directly,
      because then regexp can't have internal tests (or at least they become more
      difficult to write), for fear of an import cycle. The solution we've been using
      is for the generated test main package (pseudo-import path "testmain", package main)
      to import regexp and pass in a matchString function for use by testing when
      implementing the -run flags. This lets testing use regexp but without depending
      on regexp and creating unnecessary cycles.
      
      We want to add a few dependencies to runtime/pprof, notably regexp
      but also compress/gzip, without causing those packages to have to work
      hard to write internal tests.
      
      Restructure the (dare I say it) dependency injection of regexp.MatchString
      to be more general, and use it for the runtime/pprof functionality in addition
      to the regexp functionality. The new package testing/internal/testdeps is
      the root for the testing dependencies handled this way.
      
      Code using testing.MainStart will have to change from passing in a matchString
      implementation to passing in testdeps.TestDeps{}. Users of 'go test' don't do this,
      but other build systems that have recreated 'go test' (for example, Blaze/Bazel)
      may need to be updated. The new testdeps setup should make future updates
      unnecessary, but even so we keep the comment about MainStart not being
      subject to Go 1 compatibility.
      
      Change-Id: Iec821d2afde10c79f95f3b23de5e71b219f47b92
      Reviewed-on: https://go-review.googlesource.com/32455Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c56cc9b3
    • Russ Cox's avatar
      api: sort except.txt · 5ad3bd99
      Russ Cox authored
      Make it easier to find lines and update the file.
      
      Change-Id: I9db78ffd7316fbc17c5488e178e23777756d8f47
      Reviewed-on: https://go-review.googlesource.com/32454
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5ad3bd99
    • Russ Cox's avatar
      cmd/pprof: move cmd/internal/pprof back to cmd/pprof/internal · d5b97f61
      Russ Cox authored
      CL 21870 moved the entire cmd/pprof/internal directory to cmd/internal/pprof
      for use by cmd/trace, but really cmd/trace only needed cmd/pprof/internal/profile,
      which became cmd/internal/pprof/profile, and then internal/pprof/profile.
      
      Move the rest back under cmd/pprof so that it is clear that no other code
      is reaching into the guts of cmd/pprof. Just like functions should not be
      exported unless necessary, internals should not be made visible to more
      code than necessary.
      
      Raúl Silvera noted after the commit of CL 21870 that only the profile package
      should have moved, but there was no followup fix (until now).
      
      Change-Id: I603f4dcb0616df1e5d5eb7372e6fccda57e05079
      Reviewed-on: https://go-review.googlesource.com/32453
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      d5b97f61
    • Russ Cox's avatar
      internal/pprof/profile: new package, moved from cmd/internal/pprof/profile · 682ffae6
      Russ Cox authored
      This allows both the runtime and the cmd/pprof code to use the package,
      just like we do for internal/trace.
      
      Change-Id: I7606977284e1def36c9647354c58e7c1e93dba6b
      Reviewed-on: https://go-review.googlesource.com/32452
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      682ffae6
    • Michael Munday's avatar
      bytes, strings: update s390x code to match amd64 changes · 53cc6917
      Michael Munday authored
      Updates the s390x-specific files in these packages with the changes
      to the amd64-specific files made during the review of CL 31690. I'd
      like to keep these files in sync unless there is a reason to
      diverge.
      
      Change-Id: Id83e5ce11a45f877bdcc991d02b14416d1a2d8d2
      Reviewed-on: https://go-review.googlesource.com/32574Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      53cc6917
    • Jan Mercl's avatar
      go1.8.txt: Add CL 25345. · 235f2c72
      Jan Mercl authored
      Change-Id: I436528a4f81634448a60b1183d1b65a3bf4f48c1
      Reviewed-on: https://go-review.googlesource.com/32590Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      235f2c72