Skip to content

Commit

Permalink
rustc: Only emit gc root intrinsic calls if the GC flag is on, to wor…
Browse files Browse the repository at this point in the history
…k around #836
  • Loading branch information
pcwalton committed Aug 19, 2011
1 parent 4a894da commit 031529e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/comp/middle/trans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5626,7 +5626,9 @@ fn alloc_ty(cx: &@block_ctxt, t: &ty::t) -> result {
// past caller conventions and may well make sense again,
// so we leave it as-is.

bcx = gc::add_gc_root(bcx, val, t);
if (bcx_tcx(cx).sess.get_opts().do_gc) {
bcx = gc::add_gc_root(bcx, val, t);
}

ret rslt(cx, val);
}
Expand Down

0 comments on commit 031529e

Please sign in to comment.