go/src
Cherry Zhang be09bdf589 cmd/compile: fix unnamed parameter handling in escape analysis
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/152617
Reviewed-by: Keith Randall <khr@golang.org>
2018-12-04 23:01:00 +00:00
..
archive
bufio bufio: make Reader.Peek invalidate Unreads 2018-11-13 15:08:13 +00:00
builtin
bytes all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
cmd cmd/compile: fix unnamed parameter handling in escape analysis 2018-12-04 23:01:00 +00:00
compress
container container/heap: adjust wording in comments 2018-11-13 13:42:59 +00:00
context
crypto all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
database/sql all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
debug all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
encoding encoding/pem: test getLine does not include trailing whitespace 2018-11-19 23:35:21 +00:00
errors
expvar
flag
fmt fmt: update formatting example for maps 2018-11-26 05:08:44 +00:00
go go/types: use new importer.ForCompiler for gotype command 2018-12-04 18:23:40 +00:00
hash
html
image
index/suffixarray
internal all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
io
log
math math/big: allocate less for single-Word nats 2018-11-28 17:38:46 +00:00
mime mime: remove allocation introduced in recent fix 2018-11-20 19:09:38 +00:00
net net/http/httputil: add tests for singleJoiningSlash. 2018-12-04 05:49:46 +00:00
os os: increase default write size for TestClosedPipeRaceWrite 2018-12-04 03:32:16 +00:00
path all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
plugin plugin: fix build constraint to disable test on linux/arm64 2018-11-28 18:14:20 +00:00
reflect reflect: add comment for String method of Kind struct 2018-11-16 14:29:14 +00:00
regexp regexp: use backquotes for all regular expression examples 2018-11-20 12:05:15 +00:00
runtime all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
sort
strconv
strings strings,bytes: use inlineable function trampolines instead of linkname 2018-11-08 20:52:47 +00:00
sync
syscall syscall, cmd/go/internal/lockedfile: remove Flock syscall for aix/ppc64 2018-12-04 14:37:14 +00:00
testdata
testing all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
text
time all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
unicode unicode: improve generated comments for categories 2018-11-28 03:12:48 +00:00
unsafe cmd/compile: assume unsafe pointer arithmetic generates non-nil results 2018-11-14 21:01:36 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
make.bat build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
make.rc build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
naclmake.bash
nacltest.bash
race.bash cmd,runtime: enable race detector on arm64 2018-11-13 16:57:22 +00:00
race.bat
run.bash build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
run.bat build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
run.rc build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00