rustc: Only emit gc root intrinsic calls if the GC flag is on, to work around #836
This commit is contained in:
parent
4a894dae8e
commit
031529e3fe
1 changed files with 3 additions and 1 deletions
|
@ -5626,7 +5626,9 @@ fn alloc_ty(cx: &@block_ctxt, t: &ty::t) -> result {
|
||||||
// past caller conventions and may well make sense again,
|
// past caller conventions and may well make sense again,
|
||||||
// so we leave it as-is.
|
// 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);
|
ret rslt(cx, val);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue