cmd/compile: fix go:uintptrescapes tag for unnamed parameters

The tag was overwritten by the code for special handling unnamed
parameters.

Fixes #23045.

Change-Id: Ie2e1db3e902a07a2bbbc2a3424cea300f0a42cc3
Reviewed-on: https://go-review.googlesource.com/82775
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cherry Zhang 2017-12-07 22:01:42 -05:00
parent 91a6a2a30f
commit beeab6ac02
2 changed files with 23 additions and 4 deletions

View file

@ -2260,6 +2260,13 @@ func (e *EscState) esctag(fn *Node) {
// (Unnamed parameters are not in the Dcl list in the loop above
// so we need to mark them separately.)
for _, f := range fn.Type.Params().Fields().Slice() {
if !types.Haspointers(f.Type) { // don't bother tagging for scalars
continue
}
if f.Note == uintptrEscapesTag {
// Note is already set in the loop above.
continue
}
if f.Sym == nil || f.Sym.IsBlank() {
f.Note = mktag(EscNone)
}