]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correctly type interface data.
authorKeith Randall <khr@golang.org>
Thu, 1 May 2014 13:37:55 +0000 (09:37 -0400)
committerKeith Randall <khr@golang.org>
Thu, 1 May 2014 13:37:55 +0000 (09:37 -0400)
The backing memory for >1 word interfaces was being scanned
conservatively.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/94000043

src/pkg/runtime/iface.goc

index 08da8c7337075c17a8bef375fb2f426fd8cfb406..96bb8b8aa4b26b0fceee10cadd561ac0114b92e4 100644 (file)
@@ -161,7 +161,7 @@ copyin(Type *t, void *src, void **dst)
        if(size <= sizeof(*dst))
                alg->copy(size, dst, src);
        else {
-               p = runtimeĀ·mal(size);
+               p = runtimeĀ·cnew(t);
                alg->copy(size, p, src);
                *dst = p;
        }