]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: refactor onebitwalktype1
authorMatthew Dempsky <mdempsky@google.com>
Tue, 19 Sep 2017 06:29:46 +0000 (23:29 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 20 Sep 2017 18:11:52 +0000 (18:11 +0000)
commit39983cf491aef22579d993b59a4dffedb190666a
tree555144310290118430b9878eb086dc570c34bd72
parente06a64a4768445f2fcea1cb6b5a04abe0c4d9d12
cmd/compile: refactor onebitwalktype1

The existing logic tried to advance the offset for each variable's
width, but then tried to undo this logic with the array and struct
handling code. It can all be much simpler by only worrying about
computing offsets within the array and struct code.

While here, include a short-circuit for zero-width arrays to fix a
pedantic compiler failure case.

Passes toolstash-check.

Fixes #20739.

Change-Id: I98af9bb512a33e3efe82b8bf1803199edb480640
Reviewed-on: https://go-review.googlesource.com/64471
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/reflect.go
test/fixedbugs/issue20739.go [new file with mode: 0644]