Skip to content

Commit 031529e

Browse files
committed
rustc: Only emit gc root intrinsic calls if the GC flag is on, to work around #836
1 parent 4a894da commit 031529e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5626,7 +5626,9 @@ fn alloc_ty(cx: &@block_ctxt, t: &ty::t) -> result {
56265626
// past caller conventions and may well make sense again,
56275627
// so we leave it as-is.
56285628

5629-
bcx = gc::add_gc_root(bcx, val, t);
5629+
if (bcx_tcx(cx).sess.get_opts().do_gc) {
5630+
bcx = gc::add_gc_root(bcx, val, t);
5631+
}
56305632

56315633
ret rslt(cx, val);
56325634
}

0 commit comments

Comments
 (0)