]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: fix compiler crash during race instrumentation
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 10 Oct 2012 14:09:23 +0000 (18:09 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 10 Oct 2012 14:09:23 +0000 (18:09 +0400)
commit21b2ce724aa1310b3efb2f722d4a647be770e835
tree0a50094ea97593a92c88a9928924b5c32adaf0c0
parent27e93fbd00de218ba53a5b22333246abde88028c
cmd/gc: fix compiler crash during race instrumentation
The compiler is crashing on the following code:

type TypeID int
func (t *TypeID) encodeType(x int) (tt TypeID, err error) {
        switch x {
        case 0:
                return t.encodeType(x * x)
        }
        return 0, nil
}
The pass marks "return struct" {tt TypeID, err error} as used,
and this causes internal check failure.
I've added the test to:
https://golang.org/cl/6525052/diff/7020/src/pkg/runtime/race/regression_test.go

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6611049
src/cmd/gc/racewalk.c