Skip to content

Commit 9a09eb8

Browse files
committed
---
yaml --- r: 5911 b: refs/heads/master c: 739b1b5 h: refs/heads/master i: 5909: 00a72f4 5907: 7acebda 5903: 577b024 v: v3
1 parent a6cc43c commit 9a09eb8

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 020726c9816ff47fcdc16877a9256e5a765d6315
2+
refs/heads/master: 739b1b5b53729085f91fbce0fa9fb0530c9d56ee

trunk/src/rt/rust_cc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ class irc : public shape::data<irc,shape::ptr> {
104104
}
105105

106106
void walk_obj() {
107-
shape::data<irc,shape::ptr>::walk_obj_contents(dp);
107+
dp += sizeof(void *); // skip vtable
108+
uint8_t *box_ptr = shape::bump_dp<uint8_t *>(dp);
109+
shape::ptr ref_count_dp(box_ptr);
110+
maybe_record_irc(ref_count_dp);
108111
}
109112

110113
void walk_res(const shape::rust_fn *dtor, unsigned n_params,
@@ -491,7 +494,7 @@ class sweep : public shape::data<sweep,shape::ptr> {
491494
}
492495

493496
void walk_obj() {
494-
shape::data<sweep,shape::ptr>::walk_obj_contents(dp);
497+
return;
495498
}
496499

497500
void walk_res(const shape::rust_fn *dtor, unsigned n_params,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
type foo = { mutable z : fn@() };
2+
3+
fn nop() { }
4+
fn nop_foo(_y: o, _x : @foo) { }
5+
6+
obj o() {
7+
}
8+
9+
fn main() {
10+
let w = @{ mutable z: bind nop() };
11+
let x = bind nop_foo(o(), w);
12+
w.z = x;
13+
}

0 commit comments

Comments
 (0)