Skip to content

Commit f313993

Browse files
committed
---
yaml --- r: 909 b: refs/heads/master c: 2de59aa h: refs/heads/master i: 907: 53c76be v: v3
1 parent 3432de5 commit f313993

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fce535c04ae30d508debf9980cfc0c9475e08adc
2+
refs/heads/master: 2de59aa6b9096788577319b258469848e633938f

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,12 @@ impure fn trans_ret(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
10151015

10161016
// Run all cleanups and back out.
10171017
let bool more_cleanups = true;
1018-
auto bcx = cx;
1018+
auto cleanup_cx = cx;
10191019
while (more_cleanups) {
1020-
bcx = trans_block_cleanups(bcx);
1021-
alt (bcx.parent) {
1020+
r.bcx = trans_block_cleanups(r.bcx, cleanup_cx);
1021+
alt (cleanup_cx.parent) {
10221022
case (parent_some(?b)) {
1023-
bcx = b;
1023+
cleanup_cx = b;
10241024
}
10251025
case (parent_none) {
10261026
more_cleanups = false;
@@ -1107,9 +1107,10 @@ fn new_sub_block_ctxt(@block_ctxt bcx, str n) -> @block_ctxt {
11071107
}
11081108

11091109

1110-
fn trans_block_cleanups(@block_ctxt cx) -> @block_ctxt {
1110+
fn trans_block_cleanups(@block_ctxt cx,
1111+
@block_ctxt cleanup_cx) -> @block_ctxt {
11111112
auto bcx = cx;
1112-
for (cleanup c in cx.cleanups) {
1113+
for (cleanup c in cleanup_cx.cleanups) {
11131114
alt (c) {
11141115
case (clean(?cfn)) {
11151116
bcx = cfn(bcx).bcx;
@@ -1163,7 +1164,7 @@ impure fn trans_block(@block_ctxt cx, &ast.block b) -> result {
11631164
}
11641165
}
11651166

1166-
bcx = trans_block_cleanups(bcx);
1167+
bcx = trans_block_cleanups(bcx, bcx);
11671168
ret res(bcx, r.val);
11681169
}
11691170

0 commit comments

Comments
 (0)