cmd/gc: handle variable initialization by block move in liveness

Any initialization of a variable by a block copy or block zeroing
or by multiple assignments (componentwise copying or zeroing
of a multiword variable) needs to emit a VARDEF. These cases were not.

Fixes #7205.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/63650044
This commit is contained in:
Russ Cox 2014-02-13 22:45:16 -05:00
parent 7addda685d
commit 91b1f7cb15
6 changed files with 65 additions and 12 deletions

View file

@ -95,3 +95,21 @@ func f7() (x string) {
return
}
// ignoring block returns used to cause "live at entry to f8: x, y".
func f8() (x, y string) {
return g8()
}
func g8() (string, string)
// ignoring block assignments used to cause "live at entry to f9: x"
// issue 7205
var i9 interface{}
func f9() bool {
g8()
x := i9
return x != 99
}