aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/alias_field.zc
blob: a8d109d30e855098a12150bcdbf275472f788316 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
namespace;
include rt, run;

// expect: c: used after it was given away
struct node { int v; node* next; };
fn main() {
	node* p = rt.new(node), n = rt.new(node);
	p.next = n;
	node* c = p.next;
	rt.free(d*p);
	return c.v;
}