Skip to content

Commit 492ba6a

Browse files
committed
---
yaml --- r: 1111 b: refs/heads/master c: c44c7c5 h: refs/heads/master i: 1109: ec77adc 1107: 59aa205 1103: 86a3aaa v: v3
1 parent c3fbfb6 commit 492ba6a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-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: 56e040e61a382a831faa5c563c46ffee2f4d7333
2+
refs/heads/master: c44c7c5ab3fdd4e48fbb8f9a5e80d70a33a98f03

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ fn type_of_variant(@crate_ctxt cx, &ast.variant v) -> TypeRef {
768768
type val_and_ty_fn =
769769
fn(@block_ctxt cx, ValueRef v, @typeck.ty t) -> result;
770770

771-
// Iterates through the elements of a tup, rec or tag.
771+
// Iterates through the elements of a box, tup, rec or tag.
772772
fn iter_structural_ty(@block_ctxt cx,
773773
ValueRef v,
774774
@typeck.ty t,
@@ -968,7 +968,13 @@ fn incr_all_refcnts(@block_ctxt cx,
968968
fn drop_slot(@block_ctxt cx,
969969
ValueRef slot,
970970
@typeck.ty t) -> result {
971-
be drop_ty(cx, load_non_structural(cx, slot, t), t);
971+
auto llptr = load_non_structural(cx, slot, t);
972+
auto re = drop_ty(cx, llptr, t);
973+
974+
auto llty = val_ty(slot);
975+
auto llelemty = lib.llvm.llvm.LLVMGetElementType(llty);
976+
re.bcx.build.Store(C_null(llelemty), slot);
977+
ret re;
972978
}
973979

974980
fn drop_ty(@block_ctxt cx,

0 commit comments

Comments
 (0)