diff options
| author | Iskander Sharipov <iskander.sharipov@intel.com> | 2018-08-14 19:22:16 +0300 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2018-09-03 16:46:59 +0000 |
| commit | 67ac554d7978eb93f3dfe7a819c67948dd291d88 (patch) | |
| tree | 80b5c226f42bfa67256c90c67adf8189eead3110 /src | |
| parent | 5ed30d82b7ad4d5be12db588f088c34f8c1c0a86 (diff) | |
| download | go-67ac554d7978eb93f3dfe7a819c67948dd291d88.tar.xz | |
cmd/compile/internal/gc: fix invalid positions for sink nodes in esc.go
Make OAS2 and OAS2FUNC sink locations point to the assignment position,
not the nth LHS position.
Fixes #26987
Change-Id: Ibeb9df2da754da8b6638fe1e49e813f37515c13c
Reviewed-on: https://go-review.googlesource.com/129315
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/esc.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go index a852e0a3d0..99f046ad21 100644 --- a/src/cmd/compile/internal/gc/esc.go +++ b/src/cmd/compile/internal/gc/esc.go @@ -886,8 +886,9 @@ opSwitch: case OAS2: // x,y = a,b if n.List.Len() == n.Rlist.Len() { rs := n.Rlist.Slice() + where := n for i, n := range n.List.Slice() { - e.escassignWhyWhere(n, rs[i], "assign-pair", n) + e.escassignWhyWhere(n, rs[i], "assign-pair", where) } } @@ -928,11 +929,12 @@ opSwitch: // esccall already done on n.Rlist.First(). tie it's Retval to n.List case OAS2FUNC: // x,y = f() rs := e.nodeEscState(n.Rlist.First()).Retval.Slice() + where := n for i, n := range n.List.Slice() { if i >= len(rs) { break } - e.escassignWhyWhere(n, rs[i], "assign-pair-func-call", n) + e.escassignWhyWhere(n, rs[i], "assign-pair-func-call", where) } if n.List.Len() != len(rs) { Fatalf("esc oas2func") |
