From 70fedcbbc0b70ae33c20ec58619aa6e712121d98 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Sat, 16 Jul 2016 18:27:55 +0000 Subject: [PATCH] Reset the thread local state between compiles. --- src/rusti/exec.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rusti/exec.rs b/src/rusti/exec.rs index 775d323..cb94f63 100644 --- a/src/rusti/exec.rs +++ b/src/rusti/exec.rs @@ -305,6 +305,7 @@ impl Write for SyncBuf { fn compile_input(input: Input, sysroot: PathBuf, libs: Vec) -> Option<(llvm::ModuleRef, Deps)> { let r = monitor(move || { + driver::reset_thread_local_state(); let opts = build_exec_options(sysroot, libs); let dep_graph = DepGraph::new(opts.build_dep_graph()); let cstore = Rc::new(CStore::new(&dep_graph)); @@ -369,6 +370,7 @@ fn with_analysis(f: F, input: Input, sysroot: PathBuf, libs: Vec) where F: Send + 'static, R: Send + 'static, F: for<'a, 'gcx, 'tcx> FnOnce(&Crate, &ty::TyCtxt<'a, 'gcx, 'tcx>, ty::CrateAnalysis) -> R { monitor(move || { + driver::reset_thread_local_state(); let opts = build_exec_options(sysroot, libs); let dep_graph = DepGraph::new(opts.build_dep_graph()); let cstore = Rc::new(CStore::new(&dep_graph));