2012-04-09 17:54:51 -05:00
|
|
|
// error-pattern:ran out of stack
|
|
|
|
// xfail-test - right now we leak when we fail during failure
|
|
|
|
|
|
|
|
// Test that the task fails after hiting the recursion limit
|
|
|
|
// durnig unwinding
|
|
|
|
|
|
|
|
fn recurse() {
|
|
|
|
log(debug, "don't optimize me out");
|
|
|
|
recurse();
|
|
|
|
}
|
|
|
|
|
2012-06-04 19:04:08 -05:00
|
|
|
class r {
|
|
|
|
let recursed: *mut bool;
|
|
|
|
new(recursed: *mut bool) unsafe { self.recursed = recursed; }
|
|
|
|
drop unsafe {
|
2012-04-09 17:54:51 -05:00
|
|
|
if !*recursed {
|
|
|
|
*recursed = true;
|
|
|
|
recurse();
|
|
|
|
}
|
2012-06-04 19:04:08 -05:00
|
|
|
}
|
2012-04-09 17:54:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut recursed = false;
|
|
|
|
let _r = r(ptr::mut_addr_of(recursed));
|
|
|
|
recurse();
|
|
|
|
}
|