parent
587b863772
commit
4c9eee8aa4
2 changed files with 22 additions and 0 deletions
|
@ -3823,6 +3823,18 @@ fn trans_landing_pad(bcx: &@block_ctxt) {
|
|||
let llretval = llpad;
|
||||
// The landing pad block is a cleanup
|
||||
SetCleanup(bcx, llpad);
|
||||
|
||||
let bcx = bcx;
|
||||
let scope_cx = bcx;
|
||||
while true {
|
||||
scope_cx = find_scope_cx(scope_cx);
|
||||
bcx = trans_block_cleanups(bcx, scope_cx);
|
||||
scope_cx = alt scope_cx.parent {
|
||||
parent_some(b) { b }
|
||||
parent_none. { break; }
|
||||
};
|
||||
}
|
||||
|
||||
// Continue unwinding
|
||||
Resume(bcx, llretval);
|
||||
}
|
||||
|
|
10
src/test/run-fail/unwind-box.rs
Normal file
10
src/test/run-fail/unwind-box.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@0;
|
||||
failfn();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue