[OINDEXMAP] = 8,
[OINDEX] = 8,
- [OIND] = 8,
[ODOTINTER] = 8,
[ODOTMETH] = 8,
[ODOTPTR] = 8,
exprfmt(f, n->left, nprec);
return fmtprint(f, "[%N]", n->right);
+ case OCOPY:
case OCOMPLEX:
return fmtprint(f, "%#O(%N, %N)", n->op, n->left, n->right);
case OCAP:
case OCLOSE:
case OLEN:
- case OCOPY:
case OMAKE:
case ONEW:
case OPANIC:
return fmtprint(f, "(%,H...)", n->list);
return fmtprint(f, "(%,H)", n->list);
- case OMAKESLICE:
- if(count(n->list) > 2)
- return fmtprint(f, "make(%T, %N, %N)", n->type, n->left, n->right); // count list, but print l/r?
- return fmtprint(f, "make(%T, %N)", n->type, n->left);
-
case OMAKEMAP:
case OMAKECHAN:
+ case OMAKESLICE:
+ if(n->list->next)
+ return fmtprint(f, "make(%T, %,H)", n->type, n->list->next);
return fmtprint(f, "make(%T)", n->type);
case OADD:
defaultlit(&n->right->right, T);
if(isfixedarray(n->left->type)) {
n->left = nod(OADDR, n->left, N);
+ n->left->implicit = 1;
typecheck(&n->left, top);
}
if(n->right->left != N) {
}
func (b *Bar2) Leak() []int { // ERROR "leaking param: b"
- return b.i[:] // ERROR "&b.i escapes to heap"
+ return b.i[:] // ERROR "b.i escapes to heap"
}
func (b *Bar2) AlsoNoLeak() []int { // ERROR "b does not escape"
}
func (b *Bar2) LeakSelf() { // ERROR "leaking param: b"
- b.ii = b.i[0:4] // ERROR "&b.i escapes to heap"
+ b.ii = b.i[0:4] // ERROR "b.i escapes to heap"
}
func (b *Bar2) LeakSelf2() { // ERROR "leaking param: b"
var buf []int
- buf = b.i[0:] // ERROR "&b.i escapes to heap"
+ buf = b.i[0:] // ERROR "b.i escapes to heap"
b.ii = buf
}