mirror of https://github.com/golang/go.git
[dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR
CL 410343 changes Unified IR to visit LHS before RHS/X in assign/for statement. Thus, it needs to set base.Pos before processing assignee expression, so invalid type can be reported with correct position. Updates #53058 Change-Id: Ic9f60cbf35c8bd71cb391e806396572c37811af7 Reviewed-on: https://go-review.googlesource.com/c/go/+/410794 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
d6df08693c
commit
c50c6bbc03
|
|
@ -1338,6 +1338,7 @@ func (r *reader) assign() (ir.Node, bool) {
|
||||||
|
|
||||||
case assignDef:
|
case assignDef:
|
||||||
pos := r.pos()
|
pos := r.pos()
|
||||||
|
setBasePos(pos)
|
||||||
_, sym := r.localIdent()
|
_, sym := r.localIdent()
|
||||||
typ := r.typ()
|
typ := r.typ()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1999,7 +1999,6 @@ var unifiedFailures = setOf(
|
||||||
|
|
||||||
"fixedbugs/issue7921.go", // prints "… escapes to heap", but test expects "string(…) escapes to heap"
|
"fixedbugs/issue7921.go", // prints "… escapes to heap", but test expects "string(…) escapes to heap"
|
||||||
"typeparam/issue47631.go", // unified IR can handle local type declarations
|
"typeparam/issue47631.go", // unified IR can handle local type declarations
|
||||||
"fixedbugs/issue49767.go", // unified IR reports channel element too large on different line than irgen
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func setOf(keys ...string) map[string]bool {
|
func setOf(keys ...string) map[string]bool {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue