diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-08-18 18:13:36 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-08-18 18:13:36 -0700 |
| commit | 031529e3fe34267168a43cf74dbdd9e41f12ac43 (patch) | |
| tree | 022fbd9761ba1e333ec9ab53d6ecf660b02dbd7f | |
| parent | 4a894dae8ec784480cc7d8b127a79f9418e8fa7d (diff) | |
| download | rust-031529e3fe34267168a43cf74dbdd9e41f12ac43.tar.gz rust-031529e3fe34267168a43cf74dbdd9e41f12ac43.zip | |
rustc: Only emit gc root intrinsic calls if the GC flag is on, to work around #836
| -rw-r--r-- | src/comp/middle/trans.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 122d666cc2f..1302e6d0744 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -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); } |
