From beabd872f430b4048c12bab6102df13e8e10013f Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Mon, 7 Mar 2016 10:12:19 -0800 Subject: [PATCH] cmd/compile: fix lineno restoration after SSA compilation Without SSA: $ go build -a -gcflags='-S -ssa=0' runtime 2>&1 | grep 'TEXT.*""\.init(SB)' 0x0000 00000 ($GOROOT/src/runtime/write_err.go:14) TEXT "".init(SB), $88-0 With SSA, before this CL: $ go build -a -gcflags='-S -ssa=1' runtime 2>&1 | grep 'TEXT.*""\.init(SB)' 0x0000 00000 ($GOROOT/src/runtime/traceback.go:608) TEXT "".init(SB), $152-0 With SSA, after this CL: $ go build -a -gcflags='-S -ssa=1' runtime 2>&1 | grep 'TEXT.*""\.init(SB)' 0x0000 00000 ($GOROOT/src/runtime/write_err.go:14) TEXT "".init(SB), $152-0 Change-Id: Ida3541e03a1af6ffc753ee5c3abeb653459edbf6 Reviewed-on: https://go-review.googlesource.com/20321 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/pgen.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index cd6018e736..37a0b2d440 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -484,11 +484,8 @@ func compile(fn *Node) { if ssafn != nil { genssa(ssafn, ptxt, gcargs, gclocals) - if Curfn.Func.Endlineno != 0 { - lineno = Curfn.Func.Endlineno - } ssafn.Free() - return + goto ret } Genlist(Curfn.Func.Enter) Genlist(Curfn.Nbody) -- 2.48.1