src->type = typ(TARRAY);
src->type->type = lr->n->type->type;
src->type->bound = count(ll);
+ src->type = ptrto(src->type); // make pointer so it will be tracked
src->escloopdepth = e->loopdepth;
src->lineno = n->lineno;
src->esc = EscNone; // until we find otherwise
src->type = typ(TARRAY);
src->type->type = t->type->type;
src->type->bound = count(ll);
+ src->type = ptrto(src->type); // make pointer so it will be tracked
src->esc = EscNone; // until we find otherwise
e->noesc = list(e->noesc, src);
n->right = src;
// Allocate a temporary that will be cleaned up when this statement
// completes. We could be more aggressive and try to arrange for it
// to be cleaned up when the call completes.
- n->alloc = ordertemp(n->type, order, 0);
+ n->alloc = ordertemp(n->type->type, order, 0);
}
break;
xxx = yyy
}
-// Must treat yyy as leaking because *yyy leaks, and the escape analysis
+// Must treat yyy as leaking because *yyy leaks, and the escape analysis
// summaries in exported metadata do not distinguish these two cases.
func foo13(yyy **int) { // ERROR "leaking param: yyy"
*xxx = *yyy
func G() {
var buf1 [10]byte
F1(buf1[:]) // ERROR "buf1 does not escape"
-
+
var buf2 [10]byte // ERROR "moved to heap: buf2"
- F2(buf2[:]) // ERROR "buf2 escapes to heap"
+ F2(buf2[:]) // ERROR "buf2 escapes to heap"
var buf3 [10]byte
F3(buf3[:]) // ERROR "buf3 does not escape"
-
+
var buf4 [10]byte // ERROR "moved to heap: buf4"
- F4(buf4[:]) // ERROR "buf4 escapes to heap"
+ F4(buf4[:]) // ERROR "buf4 escapes to heap"
}
type Tm struct {
func foo141() {
var f func()
-
+
t := new(Tm) // ERROR "escapes to heap"
- f = t.M // ERROR "t.M does not escape"
+ f = t.M // ERROR "t.M does not escape"
_ = f
}
func foo142() {
t := new(Tm) // ERROR "escapes to heap"
- gf = t.M // ERROR "t.M escapes to heap"
+ gf = t.M // ERROR "t.M escapes to heap"
}
// issue 3888.
}
}
}
+
+// issue 7934: missed ... if element type had no pointers
+
+var save150 []byte
+
+func foo150(x ...byte) { // ERROR "leaking param: x"
+ save150 = x
+}
+
+func bar150() {
+ foo150(1, 2, 3) // ERROR "[.][.][.] argument escapes to heap"
+}