Skip to content

Commit 8c8a72f

Browse files
committed
Reinit the stack guard on unexpected failure
1 parent a185b56 commit 8c8a72f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_driver/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,9 +1480,9 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
14801480
rlim.rlim_cur = STACK_SIZE as libc::rlim_t;
14811481
if libc::setrlimit(libc::RLIMIT_STACK, &mut rlim) != 0 {
14821482
let err = io::Error::last_os_error();
1483-
// We have already deinited the stack. Further corruption is
1484-
// not allowed.
1485-
panic!("in_rustc_thread: error calling setrlimit: {}", err);
1483+
error!("in_rustc_thread: error calling setrlimit: {}", err);
1484+
std::rt::update_stack_guard();
1485+
true
14861486
} else {
14871487
std::rt::update_stack_guard();
14881488
false

0 commit comments

Comments
 (0)