From b6b32a4fbfbe1d75f52bc8e702425259b5406b2a Mon Sep 17 00:00:00 2001 From: Daniel Morsing Date: Thu, 22 Oct 2015 13:22:06 +0100 Subject: [PATCH] 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 --- go/ssa/builder.go | 1 + go/ssa/testdata/valueforexpr.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/go/ssa/builder.go b/go/ssa/builder.go index 3f760d24..54f2ef9f 100644 --- a/go/ssa/builder.go +++ b/go/ssa/builder.go @@ -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)) } diff --git a/go/ssa/testdata/valueforexpr.go b/go/ssa/testdata/valueforexpr.go index 028c1531..4a2cb85a 100644 --- a/go/ssa/testdata/valueforexpr.go +++ b/go/ssa/testdata/valueforexpr.go @@ -12,7 +12,11 @@ func f(spilled, unspilled int) { _ = /*@Parameter*/ (unspilled) _ = /*@*/ (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)