From 33f988691ea2ff81aa2873de3dcabb93036192d7 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 6 Sep 2013 09:19:34 -0400 Subject: [PATCH] go.tools/ssa: use correct names for Captures. Until now, the name of the captured ssa.Value, not types.Var was used, leading to confusing disassembly when it was a numbered register. See: https://code.google.com/p/go/issues/detail?id=6337 Now the output is: # Free variables: # 0: a *int # 1: b *int func func@6.9() int: .0.entry: t0 = *b t1 = *a t2 = *b etc... BUG=6337 R=crawshaw CC=golang-dev https://golang.org/cl/13249049 --- ssa/func.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssa/func.go b/ssa/func.go index c7764c27..ce8eeaaa 100644 --- a/ssa/func.go +++ b/ssa/func.go @@ -430,7 +430,7 @@ func (f *Function) lookup(obj types.Object, escaping bool) Value { } outer := f.Enclosing.lookup(obj, true) // escaping v := &Capture{ - name: outer.Name(), + name: obj.Name(), typ: outer.Type(), pos: outer.Pos(), outer: outer,