When spilling arg to stack or register, if it's a newly created value,
the arg position should be preserved. Otherwise, we may end up using
position information from deadcode lines.
This fixes the minimized test case in #54625 by mdempsky@, and make
building std successfully. However, the inline trees for these tests
still be corrupted:
- fixedbugs/issue53982.go
- typeparam/issue47775.go
- typeparam/issue47775b.go
- typeparam/issue49432.go
We probably still mess up the inline position somewhere else.
Updates #54625
Change-Id: I0d87e26b9ab451b85b6e79787da74a2b79a16209
Reviewed-on: https://go-review.googlesource.com/c/go/+/425785
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
toReplace.Type = t
w = toReplace
} else {
- w = baseArg.Block.NewValue0IA(pos, OpArg, t, auxInt, aux)
+ w = baseArg.Block.NewValue0IA(baseArg.Pos, OpArg, t, auxInt, aux)
}
x.commonArgs[key] = w
if toReplace != nil {
toReplace.Type = t
w = toReplace
} else {
- w = baseArg.Block.NewValue0IA(pos, op, t, auxInt, aux)
+ w = baseArg.Block.NewValue0IA(baseArg.Pos, op, t, auxInt, aux)
}
x.commonArgs[key] = w
if toReplace != nil {