]> git.lizzy.rs Git - rust.git/commitdiff
Fix running code via '-Z jit'
authorAlex Crichton <alex@alexcrichton.com>
Sat, 13 Jul 2013 06:26:23 +0000 (23:26 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 14 Jul 2013 04:25:17 +0000 (21:25 -0700)
src/librustc/back/link.rs
src/librustc/rustc.rs

index c65d2fbdec5226c56ccb9c9e8f66b7616d68daef..593a1ed535d6b76f1fa702a2db9b1d06d642bc06 100644 (file)
@@ -200,6 +200,8 @@ pub fn exec(sess: Session,
         }
     }
 
+    // The stage1 compiler won't work, but that doesn't really matter. TLS
+    // changed only very recently to allow storage of owned values.
     fn engine_key(_: ~Engine) {}
 
     #[cfg(not(stage0))]
@@ -213,6 +215,8 @@ fn set_engine(_: ~Engine) {}
     pub fn consume_engine() -> Option<~Engine> {
         unsafe { local_data::pop(engine_key) }
     }
+    #[cfg(stage0)]
+    pub fn consume_engine() -> Option<~Engine> { None }
 }
 
 pub mod write {
index 542183e24db7632fef35d4925b4e2d577c836f8d..1e5e9ece288e856a646f94c7589025af6f4dd79e 100644 (file)
@@ -332,7 +332,11 @@ impl Drop for finally {
 
         let _finally = finally { ch: ch };
 
-        f(demitter)
+        f(demitter);
+
+        // Due reasons explain in #7732, if there was a jit execution context it
+        // must be consumed and passed along to our parent task.
+        back::link::jit::consume_engine()
     } {
         result::Ok(_) => { /* fallthrough */ }
         result::Err(_) => {