• David Chase's avatar
    cmd/compile: initialize line number properly for temporaries · 7929a0dd
    David Chase authored
    The expansion of structure, array, slice, and map literals
    does not use the right line number in its introduced assignments
    to temporaries, which leads to incorrect line number attribution
    for expressions in those literals.
    
    Inlining also incorrectly replaced the line numbers of args to
    inlined functions.
    
    This was revealed in CL 9721 because a now-avoided temporary
    assignment introduced the correct line number.
    I.e. before CL 9721
      "tmp_wrongline := expr"
    was transformed to
      "tmp_rightline := expr; tmp_wrongline := tmp_rightline"
    
    Also includes a repair to CL 10334 involving line numbers
    where a spurious -1 remained (should have been 0, now is 0).
    
    Fixes #11400.
    
    Change-Id: I3a4687efe463977fa1e2c996606f4d91aaf22722
    Reviewed-on: https://go-review.googlesource.com/11730
    Run-TryBot: David Chase <drchase@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarSameer Ajmani <sameer@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    7929a0dd
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
newlink Loading commit data...
nm Loading commit data...
objdump Loading commit data...
old5a Loading commit data...
old6a Loading commit data...
old8a Loading commit data...
old9a Loading commit data...
pack Loading commit data...
pprof Loading commit data...
trace Loading commit data...
vet Loading commit data...
yacc Loading commit data...