]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix inlining of labeled for loops
authorDan Scales <danscales@google.com>
Wed, 20 Oct 2021 20:56:15 +0000 (13:56 -0700)
committerDan Scales <danscales@google.com>
Thu, 21 Oct 2021 19:08:43 +0000 (19:08 +0000)
commitb8da7e4c4c9e97b3d1ebfb07506acdd61277b988
tree6ed74feb1428290008671b2eb6e40d11e3924e6f
parentf99e40aac023d818e8c2594e5b8c075786087132
cmd/compile: fix inlining of labeled for loops

There is already a mechanism using inlgen to rename labels insided
inlined functions so that they are unique and don't clash with loops in
the outer function. This is used for OLABEL and OGOTO. Now that we are
doing inlining of OFOR loops, we need to do this translation for OBREAK,
OCONTINUE, and OFOR. I also added the translation for ORANGE loops, in
anticipation of a CL that will allow inlining of ORANGE for loops.

Fixes #49100

Change-Id: I2ccddc3350370825c386965f4a1e4bc54d3c369b
Reviewed-on: https://go-review.googlesource.com/c/go/+/357649
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue49100.go [new file with mode: 0644]
test/fixedbugs/issue49100.out [new file with mode: 0644]