]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/inline: revise closure inl position fix
authorThan McIntosh <thanm@google.com>
Tue, 23 Nov 2021 13:19:45 +0000 (08:19 -0500)
committerThan McIntosh <thanm@google.com>
Wed, 24 Nov 2021 15:55:56 +0000 (15:55 +0000)
commit465b4028082339bb7aa64ed6e30aef4c0b0413b4
tree177dda0d18660ab83172a506fa181db2a0c7355b
parent47db3bb443774c0b0df2cab188aa3d76b361dca2
cmd/compile/internal/inline: revise closure inl position fix

This patch revises the fix for issue 46234, fixing a bug that was
accidentally introduced by CL 320913. When inlining a chunk of code
with a closure expression, we want to avoid updating the source
positions in the function being closed over, but we do want to update
the position for the ClosureExpr itself (since it is part of the
function we are inlining). CL 320913 unintentionally did away with the
closure expr source position update; here we restore it again.

Updates #46234.
Fixes #49171.

Change-Id: Iaa51bc498e374b9e5a46fa0acd7db520edbbbfca
Reviewed-on: https://go-review.googlesource.com/c/go/+/366494
Trust: Than McIntosh <thanm@google.com>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/inline/inl.go
test/closure3.dir/main.go
test/inline.go