]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: resolve static addresses of the form &x.f at link time
authorKeith Randall <khr@golang.org>
Tue, 16 Dec 2014 22:15:49 +0000 (14:15 -0800)
committerKeith Randall <khr@golang.org>
Thu, 18 Dec 2014 21:53:03 +0000 (21:53 +0000)
commit2fc29a83ae265bba0f35e4cde44786b7e6fbd64c
tree9410bf7a3586dd0a59a18a101bdb9223c5d0932e
parent340ef004d63bd02740b31c5abb2f1105533a87b1
cmd/gc: resolve static addresses of the form &x.f at link time

When we do y = &x for global variables x and y, y gets initialized
at link time.  Do the same for y = &x.f if x is a struct and y=&x[5]
if x is an array.

fixes #9217
fixes #9355

Change-Id: Iea3c0ce2ce1b309e2b760e345608fd95460b5713
Reviewed-on: https://go-review.googlesource.com/1691
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/gc/sinit.c
test/fixedbugs/issue9355.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue9355.go [new file with mode: 0644]