]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: emit code for extern = <N>
authorDaniel Morsing <daniel.morsing@gmail.com>
Mon, 20 Oct 2014 14:59:10 +0000 (15:59 +0100)
committerDaniel Morsing <daniel.morsing@gmail.com>
Mon, 20 Oct 2014 14:59:10 +0000 (15:59 +0100)
commit0edafefc36b39dd456d3b6410f81dfcecfef6a3b
tree64e54a012a528062e2f04bcec06e99132b7fabc0
parent63acc48f8794aa51b91d7e482ba9271e54d3f77a
cmd/gc: emit code for extern = <N>

https://golang.org/cl/152700045/ made it possible for struct literals assigned to globals to use <N> as the RHS. Normally, this is to zero out variables on first use. Because globals are already zero (or their linker initialized value), we just ignored this.

Now that <N> can occur from non-initialization code, we need to emit this code. We don't use <N> for initialization of globals any more, so this shouldn't cause any excessive zeroing.

Fixes #8961.

LGTM=rsc
R=golang-codereviews, rsc
CC=bradfitz, golang-codereviews
https://golang.org/cl/154540044
src/cmd/gc/gen.c
test/fixedbugs/issue8961.go [new file with mode: 0644]