Skip to content

Commit 8022442

Browse files
committed
---
yaml --- r: 63651 b: refs/heads/snap-stage3 c: 721164d h: refs/heads/master i: 63649: 7eaf009 63647: 7814297 v: v3
1 parent 8b6c012 commit 8022442

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d9f6dd263c16a21108c27dbf15a3d59a43a5b490
4+
refs/heads/snap-stage3: 721164d5ec0c8b617bd72df36830fe1861e6362b
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/glue.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,6 @@ pub fn trans_struct_drop(mut bcx: block, t: ty::t, v0: ValueRef, dtor_did: ast::
484484
bcx = drop_ty(bcx, llfld_a, fld.mt.ty);
485485
}
486486

487-
// Zero out the struct
488-
unsafe {
489-
let ty = Type::from_ref(llvm::LLVMTypeOf(v0));
490-
memzero(bcx, v0, ty);
491-
}
492-
493487
bcx
494488
}
495489

@@ -635,6 +629,23 @@ pub fn make_take_glue(bcx: block, v: ValueRef, t: ty::t) {
635629
ty::ty_opaque_closure_ptr(ck) => {
636630
closure::make_opaque_cbox_take_glue(bcx, ck, v)
637631
}
632+
ty::ty_struct(did, ref substs) => {
633+
let tcx = bcx.tcx();
634+
let bcx = iter_structural_ty(bcx, v, t, take_ty);
635+
636+
match ty::ty_dtor(tcx, did) {
637+
ty::TraitDtor(dtor, false) => {
638+
// Zero out the struct
639+
unsafe {
640+
let ty = Type::from_ref(llvm::LLVMTypeOf(v));
641+
memzero(bcx, v, ty);
642+
}
643+
644+
}
645+
_ => { }
646+
}
647+
bcx
648+
}
638649
_ if ty::type_is_structural(t) => {
639650
iter_structural_ty(bcx, v, t, take_ty)
640651
}

0 commit comments

Comments
 (0)