mirror of
https://github.com/golang/go
synced 2024-11-18 21:44:45 -07:00
go/ssa: emit DebugRefs for x, y = z() assignments
This would cause oracle callee lookup failures when the RHS is an invoke-style call. Fixes golang/go#12999 Change-Id: Ifd561c4e7bf26f57ace5f62afac746b926c70993 Reviewed-on: https://go-review.googlesource.com/16210 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
f941d540e3
commit
b6b32a4fbf
@ -1054,6 +1054,7 @@ func (b *builder) assignStmt(fn *Function, lhss, rhss []ast.Expr, isDef bool) {
|
||||
} else {
|
||||
// e.g. x, y = pos()
|
||||
tuple := b.exprN(fn, rhss[0])
|
||||
emitDebugRef(fn, rhss[0], tuple, false)
|
||||
for i, lval := range lvals {
|
||||
lval.store(fn, emitExtract(fn, tuple, i))
|
||||
}
|
||||
|
4
go/ssa/testdata/valueforexpr.go
vendored
4
go/ssa/testdata/valueforexpr.go
vendored
@ -12,7 +12,11 @@ func f(spilled, unspilled int) {
|
||||
_ = /*@Parameter*/ (unspilled)
|
||||
_ = /*@<nil>*/ (1 + 2) // (constant)
|
||||
i := 0
|
||||
|
||||
f := func() (int, int) { return 0, 0 }
|
||||
|
||||
/*@Call*/ (print( /*@BinOp*/ (i + 1)))
|
||||
_, _ = /*@Call*/ (f())
|
||||
ch := /*@MakeChan*/ (make(chan int))
|
||||
/*@UnOp*/ (<-ch)
|
||||
x := /*@UnOp*/ (<-ch)
|
||||
|
Loading…
Reference in New Issue
Block a user