• Than McIntosh's avatar
    cmd/compile: workaround for inconsistent receiver param srcpos · 5e1dcb7a
    Than McIntosh authored
    Given an inlinable method M in package P:
    
       func (r *MyStruct) M(...) {
    
    When M is compiled within its home package, the source position that
    the compiler records for 'r' (receiver parameter variable) is
    accurate, whereas if M is built as part of the compilation of some
    other package (body read from export data), the declaration line
    assigned to 'r' will be the line number of the 'import' directive, not
    the source line from M's source file.
    
    This inconsistency can cause differences in the size of abstract
    parameter DIEs (due to variable-length encoding), which can then in
    turn result in bad abstract origin offsets, which in turn triggers
    build failures on iOS (dsymutil crashes when it encounters an
    incorrect abstract origin reference).
    
    Work around the problem by removing the "declaration line number"
    attribute within the abstract parameter abbreviation table entry. The
    decl line attribute doesn't contribute a whole lot to the debugging
    experience, and it gets rid of the inconsistencies that trigger the
    dsymutil crashes.
    
    Updates #23374.
    
    Change-Id: I0fdc8e19a48db0ccd938ceadf85103936f89ce9f
    Reviewed-on: https://go-review.googlesource.com/87055
    Run-TryBot: Than McIntosh <thanm@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
    5e1dcb7a
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...