Skip to content

Commit d21e8ca

Browse files
committed
---
yaml --- r: 4647 b: refs/heads/master c: c01e487 h: refs/heads/master i: 4645: cad56a7 4643: 47f5cad 4639: 42de812 v: v3
1 parent a3dfa3f commit d21e8ca

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
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: 60e1cead9bab129b1937a11c71ab2ab2fd751792
2+
refs/heads/master: c01e48748504934e27ac89b2ca12d7d626e3be42

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3805,7 +3805,14 @@ fn trans_do_while(cx: &@block_ctxt, body: &ast::blk, cond: &@ast::expr) ->
38053805
if is_terminated(body_res.bcx) {
38063806
// This is kind of ridiculous, but no permutations
38073807
// involving body_res or body_cx.val worked.
3808-
ret trans_block(cx, body, return);
3808+
let rs = trans_block(cx, body, return);
3809+
if ! is_terminated (next_cx) {
3810+
next_cx.build.Unreachable();
3811+
}
3812+
if ! is_terminated (body_cx) {
3813+
body_cx.build.Unreachable();
3814+
}
3815+
ret rs;
38093816
}
38103817
let cond_res = trans_expr(body_res.bcx, cond);
38113818
cond_res.bcx.build.CondBr(cond_res.val, body_cx.llbb, next_cx.llbb);

trunk/src/test/run-fail/do-while-body-fails.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// xfail-stage1
2-
// xfail-stage2
3-
// xfail-stage3
41
// error-pattern:quux
52
fn main() {
63
let x: int = do { fail "quux" } while (true);

0 commit comments

Comments
 (0)