Skip to content

Commit 6473f12

Browse files
committed
---
yaml --- r: 5187 b: refs/heads/master c: 985ef59 h: refs/heads/master i: 5185: 75fdc42 5183: 656a8d1 v: v3
1 parent d034db0 commit 6473f12

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
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: 0eb56e60d212fb53dcb2e0c7c33a4539b9203428
2+
refs/heads/master: 985ef59efd971f1d6b9bf4b5e484b75733e00444

trunk/src/comp/middle/trans.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,19 +2478,13 @@ fn trans_for(cx: &@block_ctxt, local: &@ast::local, seq: &@ast::expr,
24782478
fn inner(cx: &@block_ctxt, local: @ast::local, curr: ValueRef, t: ty::t,
24792479
body: &ast::blk, outer_next_cx: @block_ctxt) -> @block_ctxt {
24802480
let next_cx = new_sub_block_ctxt(cx, "next");
2481-
let scope_cx =
2482-
new_loop_scope_block_ctxt(cx,
2483-
option::some::<@block_ctxt>(next_cx),
2484-
outer_next_cx, "for loop scope");
2485-
Br(cx, scope_cx.llbb);
2486-
let {bcx, val: dst} = alloc_local(scope_cx, local);
2487-
let val = load_if_immediate(bcx, PointerCast(bcx, curr,
2488-
val_ty(dst)), t);
2489-
let bcx = copy_val(bcx, INIT, dst, val, t);
2490-
add_clean(scope_cx, dst, t);
2491-
let bcx = trans_alt::bind_irrefutable_pat(bcx, local.node.pat, dst,
2481+
let bcx = new_loop_scope_block_ctxt(cx, option::some(next_cx),
2482+
outer_next_cx, "for loop scope");
2483+
Br(cx, bcx.llbb);
2484+
let val = PointerCast(bcx, curr, T_ptr(type_of_or_i8(cx, t)));
2485+
let bcx = trans_alt::bind_irrefutable_pat(bcx, local.node.pat, val,
24922486
cx.fcx.lllocals, false);
2493-
bcx = trans_block(bcx, body, return).bcx;
2487+
let bcx = trans_block(bcx, body, return).bcx;
24942488
if !is_terminated(bcx) {
24952489
Br(bcx, next_cx.llbb);
24962490
// otherwise, this code is unreachable

0 commit comments

Comments
 (0)