• 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
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...