]> Cypherpunks repositories - gostls13.git/commitdiff
two uses of uninitialized memory,
authorRuss Cox <rsc@golang.org>
Fri, 30 Jan 2009 23:11:46 +0000 (15:11 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 30 Jan 2009 23:11:46 +0000 (15:11 -0800)
picked up by valgrind.
fixes test/escape.go on linux.

R=ken
OCL=23971
CL=23971

src/cmd/6g/cgen.c
src/cmd/6g/gsubr.c

index ba1427d014a40c1dd2fb66b98f30b409fae512ee..4a7404e8ca8eead9a58ffe24f1767ddff80f6138 100644 (file)
@@ -118,7 +118,7 @@ cgen(Node *n, Node *res)
                        p1 = gins(a, N, res);
                        p1->from = addr;
                } else {
-                       regalloc(&n2, n->type, &n1);
+                       regalloc(&n2, n->type, N);
                        p1 = gins(a, N, &n2);
                        p1->from = addr;
                        gins(a, &n2, res);
index 0f71c104c837c57c9f7d31b3b180d236655a0d4e..67def9952718f6e7bc02e21d4eefa21b36279fbb 100644 (file)
@@ -1006,7 +1006,8 @@ gins(int as, Node *f, Node *t)
 void
 naddr(Node *n, Addr *a)
 {
-
+       a->scale = 0;
+       a->index = D_NONE;
        a->type = D_NONE;
        if(n == N)
                return;