Skip to content

Commit b4ed021

Browse files
committed
---
yaml --- r: 3593 b: refs/heads/master c: ded9008 h: refs/heads/master i: 3591: db4e84d v: v3
1 parent 3c78401 commit b4ed021

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
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: 6d0cb70fc36f444c07372ae58d641a6d8483cc95
2+
refs/heads/master: ded9008e3850463a21d1d0d48ad35a02e42bae7c

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4312,7 +4312,10 @@ fn trans_for(&@block_ctxt cx, &@ast::local local, &@ast::expr seq,
43124312
auto bcx = copy_val(local_res.bcx, INIT, local_res.val, curr, t).bcx;
43134313
scope_cx.cleanups += [clean(bind drop_slot(_, local_res.val, t))];
43144314
bcx = trans_block(bcx, body, return).bcx;
4315-
bcx.build.Br(next_cx.llbb);
4315+
if (!bcx.build.is_terminated()) {
4316+
bcx.build.Br(next_cx.llbb);
4317+
// otherwise, this code is unreachable
4318+
}
43164319
ret rslt(next_cx, C_nil());
43174320
}
43184321
auto next_cx = new_sub_block_ctxt(cx, "next");

0 commit comments

Comments
 (0)