提交 4c9eee8a 编写于 作者: B Brian Anderson

Run cleanups during unwinding

Issue #236
上级 587b8637
......@@ -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);
}
......
// error-pattern:fail
fn failfn() {
fail;
}
fn main() {
@0;
failfn();
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册