]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix exporting of 'for' loops
authorRobert Griesemer <gri@golang.org>
Mon, 18 Jun 2018 21:38:45 +0000 (14:38 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 19 Jun 2018 16:35:58 +0000 (16:35 +0000)
commitf125052ad5327c986ad81da48015696b7f8bd632
treeeb9052a3de9da3e305d0dd58600a38c21a6e086a
parentc99300229de4e69220790c71da14785dc52c3d68
cmd/compile: fix exporting of 'for' loops

The existing code for encoding 'for' loops in exported, inlineable
functions incorrectly assumed that the 'Right' field points to an
'expression' node. Adjusted the code to be able to handle any kind
of node. Made matching changes for the binary and indexed exporter.

This only shows up together with other pending compiler changes that
enable exporting of such functions which contain for loops.

No tests yet because we can't test this w/o those pending compiler
changes. Once those changes are in, this code will be tested implicitly.
However, the changes were tested manually together with the patches
described in the issue.

Fixes #25222.

Change-Id: I54babb87e5d665d2c1ef6116c1de1b8c50b1138e
Reviewed-on: https://go-review.googlesource.com/119595
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/iexport.go
src/cmd/compile/internal/gc/iimport.go