Skip to content

Commit bc7af98

Browse files
committed
---
yaml --- r: 4573 b: refs/heads/master c: 051b401 h: refs/heads/master i: 4571: 889c177 v: v3
1 parent bc227f6 commit bc7af98

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 19bbd0204970f7a41bafa40016ac52366666d02e
2+
refs/heads/master: 051b401051727d8d4e2ee27f9242b24158831f81

trunk/src/comp/middle/trans.rs

+5
Original file line numberDiff line numberDiff line change
@@ -3802,6 +3802,11 @@ fn trans_do_while(cx: &@block_ctxt, body: &ast::blk, cond: &@ast::expr) ->
38023802
new_loop_scope_block_ctxt(cx, option::none[@block_ctxt], next_cx,
38033803
"do-while loop body");
38043804
let body_res = trans_block(body_cx, body, return);
3805+
if is_terminated(body_res.bcx) {
3806+
// This is kind of ridiculous, but no permutations
3807+
// involving body_res or body_cx.val worked.
3808+
ret trans_block(cx, body, return);
3809+
}
38053810
let cond_res = trans_expr(body_res.bcx, cond);
38063811
cond_res.bcx.build.CondBr(cond_res.val, body_cx.llbb, next_cx.llbb);
38073812
cx.build.Br(body_cx.llbb);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// error-pattern:quux
2+
fn main() {
3+
let x: int = do { fail "quux" } while (true);
4+
}

0 commit comments

Comments
 (0)