]> Cypherpunks repositories - gostls13.git/commitdiff
5g: fix out of registers bug
authorRuss Cox <rsc@golang.org>
Sat, 11 Feb 2012 05:04:37 +0000 (00:04 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 11 Feb 2012 05:04:37 +0000 (00:04 -0500)
Same fix as 6g, tripped by the 6g test case.

R=ken2
CC=golang-dev
https://golang.org/cl/5651074

src/cmd/5g/cgen.c

index 8865027dcaa1fa0b5dcdd645638f3a7d287c78f5..4912dcd99c78e525c9a573a28fd8695ee3896413 100644 (file)
@@ -402,9 +402,9 @@ abop:       // asymmetric binary
                regalloc(&n2, nr->type, N);
                cgen(nr, &n2);
        } else {
-               regalloc(&n2, nr->type, N);
+               regalloc(&n2, nr->type, res);
                cgen(nr, &n2);
-               regalloc(&n1, nl->type, res);
+               regalloc(&n1, nl->type, N);
                cgen(nl, &n1);
        }
        gins(a, &n2, &n1);