Skip to content

Commit 66fa1a4

Browse files
committed
---
yaml --- r: 5367 b: refs/heads/master c: 9626e2f h: refs/heads/master i: 5365: 61899ee 5363: b6670c4 5359: 728ffa4 v: v3
1 parent 1fa3baf commit 66fa1a4

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: a18986c1a1a0b0fe08ad30685c5f321d9352a06e
2+
refs/heads/master: 9626e2f71f86dd710c810b3c92cb8c84ecde6364

trunk/src/comp/middle/trans.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3939,7 +3939,6 @@ fn trans_tup(cx: @block_ctxt, elts: [@ast::expr], id: ast::node_id) ->
39393939
let tup_res = alloc_ty(bcx, t);
39403940
let tup_val = tup_res.val;
39413941
bcx = tup_res.bcx;
3942-
add_clean_temp(cx, tup_val, t);
39433942
let i: int = 0;
39443943
for e in elts {
39453944
let e_ty = ty::expr_ty(cx.fcx.lcx.ccx.tcx, e);
@@ -3951,6 +3950,9 @@ fn trans_tup(cx: @block_ctxt, elts: [@ast::expr], id: ast::node_id) ->
39513950
bcx = move_val_if_temp(dst_res.bcx, INIT, dst_res.val, src, e_ty);
39523951
i += 1;
39533952
}
3953+
3954+
// Only register the cleanups after the tuple is built
3955+
add_clean_temp(cx, tup_val, t);
39543956
ret rslt(bcx, tup_val);
39553957
}
39563958

trunk/src/test/run-fail/unwind-tup.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// error-pattern:fail
2+
3+
fn fold_local() -> @[int]{
4+
fail;
5+
}
6+
7+
fn main() {
8+
let lss = (fold_local(), 0);
9+
}

0 commit comments

Comments
 (0)