]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: set OFOR bBody.Pos to AST Pos
authorPeter Waller <p@pwaller.net>
Mon, 18 Feb 2019 11:09:03 +0000 (11:09 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 7 Mar 2019 22:27:52 +0000 (22:27 +0000)
commit7afd58d4581925788e1ef28ff817784d2585b92f
treee26ed9fd3773d79f000f57fc8dde5ce0cbbb83d4
parent27cce773d3338d282039fd250c0f9bff3ecab3b0
cmd/compile/internal/ssa: set OFOR bBody.Pos to AST Pos

Assign SSA OFOR's bBody.Pos to AST (*Node).Pos as it is created.

An empty for loop has no other information which may be used to give
correct position information in the resulting executable. Such a for
loop may compile to a single `JMP *self` and it is important that the
location of this is in the right place.

Fixes #30167.

Change-Id: Iec44f0281c462c33fac6b7b8ccfc2ef37434c247
Reviewed-on: https://go-review.googlesource.com/c/go/+/163019
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go