]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: Reset haspointers computation. When converting from a
authorKeith Randall <khr@golang.org>
Sat, 24 Aug 2013 00:28:15 +0000 (17:28 -0700)
committerKeith Randall <khr@golang.org>
Sat, 24 Aug 2013 00:28:15 +0000 (17:28 -0700)
slice type to an array type, the haspointer-ness may change.
Before this change, we'd sometimes get types like [1]int marked
as having pointers.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13189044

src/cmd/gc/sinit.c

index 51c5f7022222ab5200c32c6bb554fc830492748e..19faf4e9568c251d57ad6e1d8a8f91fa09d53ada 100644 (file)
@@ -686,6 +686,7 @@ slicelit(int ctxt, Node *n, Node *var, NodeList **init)
        t->bound = mpgetfix(n->right->val.u.xval);
        t->width = 0;
        t->sym = nil;
+       t->haspointers = 0;
        dowidth(t);
 
        if(ctxt != 0) {