There's not really any use to tracking function-scoped constants and
types on Curfn.Dcl, and there's sloppy code that assumes all of the
declarations are variables (e.g., cmpstackvarlt).
Change-Id: I5d10dc681dac2c161c7b73ba808403052ca0608e
Reviewed-on: https://go-review.googlesource.com/c/go/+/274436
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
base.Pos = n.Pos()
base.Fatalf("automatic outside function")
}
- if Curfn != nil && ctxt != ir.PFUNC {
+ if Curfn != nil && ctxt != ir.PFUNC && n.Op() == ir.ONAME {
Curfn.Dcl = append(Curfn.Dcl, n)
}
if n.Op() == ir.OTYPE {
}
ret := T{}
ret.s[0] = f()
- return ret // ERROR "stack object .autotmp_5 T"
+ return ret // ERROR "stack object .autotmp_[0-9]+ T"
}