Check for is_terminated after translating a block

Closes #861
This commit is contained in:
Marijn Haverbeke 2011-08-24 10:55:34 +02:00
parent 18576e55f7
commit bead045f27

View File

@ -4303,7 +4303,7 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
with_out_method(bind trans_block(sub_cx, blk, _), cx, e.id, with_out_method(bind trans_block(sub_cx, blk, _), cx, e.id,
output); output);
cx.build.Br(sub_cx.llbb); cx.build.Br(sub_cx.llbb);
sub.bcx.build.Br(next_cx.llbb); if !is_terminated(sub.bcx) { sub.bcx.build.Br(next_cx.llbb); }
ret rslt(next_cx, sub.val); ret rslt(next_cx, sub.val);
} }
ast::expr_copy(a) { ast::expr_copy(a) {