Skip to content

Commit 0fc2900

Browse files
committed
---
yaml --- r: 22938 b: refs/heads/master c: c076d3c h: refs/heads/master v: v3
1 parent c2c8364 commit 0fc2900

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 16a0f72f8ca85b1e2a1b69043dc16c6cf20cc83f
2+
refs/heads/master: c076d3ccc0a0cfc9dc61c4a3cac9ae358781f7d5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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)