1. 07 Dec, 2018 8 commits
  2. 06 Dec, 2018 10 commits
  3. 05 Dec, 2018 20 commits
  4. 04 Dec, 2018 2 commits
    • Cherry Zhang's avatar
      cmd/compile: fix unnamed parameter handling in escape analysis · be09bdf5
      Cherry Zhang authored
      For recursive functions, the parameters were iterated using
      fn.Name.Defn.Func.Dcl, which does not include unnamed/blank
      parameters. This results in a mismatch in formal-actual
      assignments, for example,
      
      func f(_ T, x T)
      
      f(a, b) should result in { _=a, x=b }, but the escape analysis
      currently sees only { x=a } and drops b on the floor. This may
      cause b to not escape when it should (or a escape when it should
      not).
      
      Fix this by using fntype.Params().FieldSlice() instead, which
      does include unnamed parameters.
      
      Also add a sanity check that ensures all the actual parameters
      are consumed.
      
      Fixes #29000
      
      Change-Id: Icd86f2b5d71e7ebbab76e375b7702f62efcf59ae
      Reviewed-on: https://go-review.googlesource.com/c/152617Reviewed-by: default avatarKeith Randall <khr@golang.org>
      be09bdf5
    • Daniel Martí's avatar
      cmd/go: revert multi-flag GOFLAGS doc example · 8a5797a0
      Daniel Martí authored
      This partially reverts https://golang.org/cl/135035.
      
      Reason for revert: multiple -ldflags=-foo flags simply override each
      other, since that's the logic for per-package flags. The suggested
      'GOFLAGS=-ldflags=-s -ldflags=-w' has never worked for 'go build', and
      even breaks 'go test' and 'go vet'.
      
      There should be a way to specify -ldflags='-w -s' via GOFLAGS, which is
      being tracked in #29096. For now, just remove the incorrect suggestion.
      
      Fixes #29053.
      
      Change-Id: I9203056f7e5191e894bcd16595a92df2fb704ea7
      Reviewed-on: https://go-review.googlesource.com/c/152479Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      8a5797a0