about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:20:21 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:21:05 -0700
commit8bd019bdc868e9d563aa72acbb0307deaeca919f (patch)
treedeadfaf2682bb480816d56526d7113a7be7ea3e2 /src/comp
parent608f7ccded67fd65d5e12ef2c0601170fb3345ed (diff)
downloadrust-8bd019bdc868e9d563aa72acbb0307deaeca919f.tar.gz
rust-8bd019bdc868e9d563aa72acbb0307deaeca919f.zip
rt: Remember the number of captured type descriptors for objects in the type descriptor crate cache
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index e4a35a8d6b6..bae944659d9 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -958,10 +958,13 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: ty::t, escapes: bool,
 
         // If the tydesc escapes in this context, the cached derived
         // tydesc also has to be one that was marked as escaping.
-        if !(escapes && !info.escapes) { ret rslt(cx, info.lltydesc); }
+        if !(escapes && !info.escapes) && storage == tps_normal {
+            ret rslt(cx, info.lltydesc);
+        }
       }
       none. {/* fall through */ }
     }
+
     bcx_ccx(cx).stats.n_derived_tydescs += 1u;
     let bcx = new_raw_block_ctxt(cx.fcx, cx.fcx.llderivedtydescs);
     let tys = linearize_ty_params(bcx, t);