1. 07 Dec, 2018 9 commits
  2. 06 Dec, 2018 10 commits
  3. 05 Dec, 2018 20 commits
  4. 04 Dec, 2018 1 commit
    • 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