]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: copy literals when inlining
authorDavid Lazar <lazard@golang.org>
Fri, 17 Feb 2017 21:07:47 +0000 (16:07 -0500)
committerDavid Lazar <lazard@golang.org>
Fri, 3 Mar 2017 21:29:32 +0000 (21:29 +0000)
commit1c6ef9aeedf951a7a1fa7f510aa42150d3051567
tree7c1f814aa6c9dba190b32aabf6cec44f2de3d4cf
parent699175a11adfe57e859f4b995f4f5dfdaa5a5911
cmd/compile: copy literals when inlining

Without this, literals keep their original source positions through
inlining, which results in strange jumps in line numbers of inlined
function bodies. By copying literals, inlining can update their source
position like other nodes.

Fixes #15453.

Change-Id: Iad5d9bbfe183883794213266dc30e31bab89ee69
Reviewed-on: https://go-review.googlesource.com/37232
Run-TryBot: David Lazar <lazard@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/inl.go
test/inline_literal.go [new file with mode: 0644]