Skip to content

Commit d8d9f2a

Browse files
committed
rustc: Unconditionally zero out all GC-relevant types for now
1 parent 907ab4a commit d8d9f2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/comp/middle/gc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import lib::llvm::False;
44
import lib::llvm::True;
55
import lib::llvm::llvm::ValueRef;
6+
import middle::trans;
67
import middle::trans::get_tydesc;
78
import middle::trans_common::*;
89
import middle::ty;
@@ -38,6 +39,10 @@ fn add_gc_root(cx: &@block_ctxt, llval: ValueRef, ty: ty::t) -> @block_ctxt {
3839

3940
let gc_cx = bcx_ccx(cx).gc_cx;
4041

42+
// FIXME (issue #839): For now, we are unconditionally zeroing out all
43+
// GC-relevant types. Eventually we should use typestate for this.
44+
bcx = trans::zero_alloca(bcx, llval, ty).bcx;
45+
4146
let ti = none;
4247
let td_r = get_tydesc(bcx, ty, false, ti);
4348
bcx = td_r.result.bcx;

0 commit comments

Comments
 (0)