diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index b0b425e3aee4..afef699390b7 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -647,7 +647,9 @@ impl Death { /// All calls must be paired with a preceding call to inhibit_kill. #[inline] pub fn allow_kill(&mut self, already_failing: bool) { - rtassert!(self.unkillable != 0); + if self.unkillable == 0 { + fail!("illegal call of rekillable"); + } self.unkillable -= 1; if self.unkillable == 0 { rtassert!(self.kill_handle.is_some()); diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index c66296723b10..d094623b57ba 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -671,7 +671,39 @@ fn test_kill_rekillable_task() { } } -#[test] #[should_fail] +#[test] +#[ignore(cfg(windows))] +#[should_fail] +fn test_rekillable_not_nested() { + do rekillable { + // This should fail before + // receiving anything since + // this block should be nested + // into a unkillable block. + yield(); + } +} + + +#[test] +#[ignore(cfg(windows))] +fn test_rekillable_nested_failure() { + + let result = do task::try { + do unkillable { + do rekillable { + let (port,chan) = comm::stream(); + do task::spawn { chan.send(()); fail!(); } + port.recv(); // wait for child to exist + port.recv(); // block forever, expect to get killed. + } + } + }; + assert!(result.is_err()); +} + + +#[test] #[should_fail] #[ignore(cfg(windows))] fn test_cant_dup_task_builder() { let mut builder = task(); builder.unlinked(); @@ -1239,20 +1271,6 @@ fn test_unkillable_nested() { po.recv(); } -#[ignore(reason = "linked failure")] -#[test] -#[ignore(cfg(windows))] -#[should_fail] -fn test_rekillable_not_nested() { - do rekillable { - // This should fail before - // receiving anything since - // this block should be nested - // into a unkillable block. - yield(); - } -} - #[test] fn test_child_doesnt_ref_parent() { // If the child refcounts the parent task, this will stack overflow when diff --git a/src/llvm b/src/llvm index 0964c68ddf2c..f67442eee27d 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 0964c68ddf2c67ce455e7443a06f4bb3db9e92bb +Subproject commit f67442eee27d3d075a65cf7f9a70f7ec6649ffd1