diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-08-23 14:51:22 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-08-23 14:51:22 -0700 |
| commit | a3c8d4a5a58b42db6b8795980992e1063e84f59f (patch) | |
| tree | b1222e51fd0cd3375b401bdafbb4a7c94b9649b2 /src/comp | |
| parent | 68fd28c2c139109bac3372c5fe6d05b228d6a579 (diff) | |
Recheck the while loop contition after continuing. Closes #825
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 309be3fd2db..5a6791c5b85 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -3188,11 +3188,11 @@ fn trans_for_each(cx: &@block_ctxt, local: &@ast::local, seq: &@ast::expr, fn trans_while(cx: &@block_ctxt, cond: &@ast::expr, body: &ast::blk) -> result { - let cond_cx = new_scope_block_ctxt(cx, "while cond"); - let next_cx = new_sub_block_ctxt(cx, "next"); + let next_cx = new_sub_block_ctxt(cx, "while next"); + let cond_cx = new_loop_scope_block_ctxt(cx, option::none::<@block_ctxt>, + next_cx, "while cond"); let body_cx = - new_loop_scope_block_ctxt(cx, option::none::<@block_ctxt>, next_cx, - "while loop body"); + new_scope_block_ctxt(cond_cx, "while loop body"); let body_res = trans_block(body_cx, body, return); let cond_res = trans_expr(cond_cx, cond); body_res.bcx.build.Br(cond_cx.llbb); |
