aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2018-05-23 15:31:52 -0400
committerThan McIntosh <thanm@google.com>2018-05-25 19:37:35 +0000
commit1ba26a33ceef7600e9801bbccf529b1112013c1a (patch)
treeb9c8ca39c3e56c9f94a868cfe72ae4f68a81782b /src/runtime
parent88756931d0a6e23aeaf61caa6a7363ac04be2063 (diff)
downloadgo-1ba26a33ceef7600e9801bbccf529b1112013c1a.tar.xz
cmd/compile: fix DWARF inline debug issue with dead local vars
Fix a problem in DWARF inline debug generation relating to handling of statically unreachable local variables. For a function such as: const always = true func HasDeadLocal() int { if always { return 9 } x := new(Something) ... return x.y } the variable "x" is placed onto the Dcl list for the function during parsing, but the actual declaration node is deleted later on when gc.Main invokes "deadcode". Later in the compile the DWARF code emits an abstract function with "x" (since "x" was on the Dcl list at the point of the inline), but the export data emitted does not contain "x". This then creates clashing/inconsistant DWARF abstract function DIEs later on if HasDeadLocal is inlined in somewhere else. As a fix, the inliner now pruned away variables such as "x" when creating a copy of the Dcl list as part of the inlining; this means that both the export data generator and the DWARF emitter wind up seeing a consistent picture. Fixes #25459 Change-Id: I753dc4e9f9ec694340adba5f43c907ba8cc9badc Reviewed-on: https://go-review.googlesource.com/114090 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions