Skip to content

Commit 8a9e743

Browse files
committed
---
yaml --- r: 31600 b: refs/heads/dist-snap c: c076d3c h: refs/heads/master v: v3
1 parent 9abcf0b commit 8a9e743

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 16a0f72f8ca85b1e2a1b69043dc16c6cf20cc83f
10+
refs/heads/dist-snap: c076d3ccc0a0cfc9dc61c4a3cac9ae358781f7d5
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3452,7 +3452,17 @@ fn trans_struct(block_context: block, span: span, fields: ~[ast::field],
34523452
}
34533453
}
34543454

3455-
let dest = GEPi(block_context, dest_address, ~[0, index]);
3455+
// If the class has a destructor, our GEP is a little more
3456+
// complicated.
3457+
let dest;
3458+
if ty::ty_dtor(block_context.tcx(), class_id).is_some() {
3459+
dest = GEPi(block_context,
3460+
GEPi(block_context, dest_address, ~[0, 1]),
3461+
~[0, index]);
3462+
} else {
3463+
dest = GEPi(block_context, dest_address, ~[0, index]);
3464+
}
3465+
34563466
block_context = trans_expr_save_in(block_context,
34573467
field.node.expr,
34583468
dest);

0 commit comments

Comments
 (0)