about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-03-20 21:15:21 +0900
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-03-20 21:15:21 +0900
commit8c8a72f8224b9cbf283cd120d87397c032ed62f1 (patch)
treef4a6456a5eb138e46feefcb01a1359cde9961da5 /src
parenta185b56b7caca17c7aa9d6f702fe1b2209c82e4e (diff)
downloadrust-8c8a72f8224b9cbf283cd120d87397c032ed62f1.tar.gz
rust-8c8a72f8224b9cbf283cd120d87397c032ed62f1.zip
Reinit the stack guard on unexpected failure
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index e39a2c2f5dc..e56c9928dcc 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1480,9 +1480,9 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
             rlim.rlim_cur = STACK_SIZE as libc::rlim_t;
             if libc::setrlimit(libc::RLIMIT_STACK, &mut rlim) != 0 {
                 let err = io::Error::last_os_error();
-                // We have already deinited the stack. Further corruption is
-                // not allowed.
-                panic!("in_rustc_thread: error calling setrlimit: {}", err);
+                error!("in_rustc_thread: error calling setrlimit: {}", err);
+                std::rt::update_stack_guard();
+                true
             } else {
                 std::rt::update_stack_guard();
                 false