Fix running code via '-Z jit'

This commit is contained in:
Alex Crichton 2013-07-12 23:26:23 -07:00
parent 6148c1c0c5
commit 21d7098427
2 changed files with 9 additions and 1 deletions

View File

@ -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 {

View File

@ -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(_) => {