diff options
author | Russ Cox <rsc@golang.org> | 2014-02-13 22:45:16 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-02-13 22:45:16 -0500 |
commit | 4203ada85b00e5de41bf8efe1f99901633c866dd (patch) | |
tree | 10f0fbd20d3f66793a46411426cbe871f11e680a /test/live.go | |
parent | e37f4869e55dee6d55a034e644c32bbd268fe9c9 (diff) | |
download | go-4203ada85b00e5de41bf8efe1f99901633c866dd.tar.gz |
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 issue 7205.
TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/63650044
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/live.go b/test/live.go index c3dbc55c0..ec2df7e5f 100644 --- a/test/live.go +++ b/test/live.go @@ -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 +} |