about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/back/link.rs4
-rw-r--r--src/librustc/rustc.rs6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index c65d2fbdec5..593a1ed535d 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -200,6 +200,8 @@ pub mod jit {
         }
     }
 
+    // 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 @@ pub mod jit {
     pub fn consume_engine() -> Option<~Engine> {
         unsafe { local_data::pop(engine_key) }
     }
+    #[cfg(stage0)]
+    pub fn consume_engine() -> Option<~Engine> { None }
 }
 
 pub mod write {
diff --git a/src/librustc/rustc.rs b/src/librustc/rustc.rs
index 542183e24db..1e5e9ece288 100644
--- a/src/librustc/rustc.rs
+++ b/src/librustc/rustc.rs
@@ -332,7 +332,11 @@ pub fn monitor(f: ~fn(diagnostic::Emitter)) {
 
         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(_) => {