go/ssa: distinguish goto from continue for range-over-func - #666
Conversation
A goto to the label on a range-over-func statement must exit the current yield and resume at the range statement in the parent function. Keep continue targeting the yield continuation, but make goto target the parent label so the existing exit lowering preserves those semantics. Fixes golang/go#80860.
Move the three rangegen correctness failures out of LLGo compatibility xfails while the remaining labeled-goto failure is fixed in x/tools. Keep the upstream runoutput directive and leave resource timeout entries unchanged. Track golang/go#80860 and golang/tools#666 in each classification reason.
|
This PR (HEAD: 468429c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/814460. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/814460. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/814460. |
Move the three rangegen correctness failures out of LLGo compatibility xfails while the remaining labeled-goto failure is fixed in x/tools. Keep the upstream runoutput directive and leave resource timeout entries unchanged. Track golang/go#80860 and golang/tools#666 in each classification reason.
|
Message from Jie Li: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/814460. |
go/ssa currently maps both goto L and continue L to the yield
continuation when L labels a range-over-func statement. A goto L must
instead stop the current iterator call and resume at the parent
function's label so that the range statement restarts.
Keep continue L targeting the yield continuation, but point goto L at
the parent's existing label block. The normal cross-function exit
lowering then records and resumes the jump correctly.
The interpreter regression test distinguishes the two operations by
restarting the same labeled range twice.
Fixes golang/go#80860.