Skip to content

Commit 8d929e2

Browse files
committed
---
yaml --- r: 2163 b: refs/heads/master c: d1b9ddc h: refs/heads/master i: 2161: 713ff8a 2159: 1b2906d v: v3
1 parent 5204563 commit 8d929e2

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
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: 6651826677842083c59725903a856eb39d8e5051
2+
refs/heads/master: d1b9ddc8d49744a4e7e478e775d02d071dbd78a4

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,12 +3583,12 @@ fn trans_for_each(@block_ctxt cx,
35833583
bcx.build.Store(lllvar, lllvarptr);
35843584
fcx.llupvars.insert(decl_id, lllvarptr);
35853585

3586-
auto res = trans_block(bcx, body);
3586+
auto r = trans_block(bcx, body);
35873587

35883588
// Tie up the llallocas -> lltop edge.
35893589
new_builder(fcx.llallocas).Br(lltop);
35903590

3591-
res.bcx.build.RetVoid();
3591+
r.bcx.build.RetVoid();
35923592

35933593

35943594
// Step 3: Call iter passing [lliterbody, llenv], plus other args.
@@ -3611,10 +3611,11 @@ fn trans_for_each(@block_ctxt cx,
36113611
cx.build.Store(llenvblobptr, env_cell);
36123612

36133613
// log "lliterbody: " + val_str(cx.fcx.lcx.ccx.tn, lliterbody);
3614-
ret trans_call(cx, f,
3614+
r = trans_call(cx, f,
36153615
some[ValueRef](cx.build.Load(pair)),
36163616
args,
36173617
ann);
3618+
ret res(r.bcx, C_nil());
36183619
}
36193620
}
36203621
fail;

trunk/src/test/run-pass/alt-phi.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tag thing { a; b; c; }
2+
3+
iter foo() -> int {
4+
put 10;
5+
}
6+
7+
fn main() {
8+
auto x = true;
9+
alt (a) {
10+
case (a) {
11+
x = true;
12+
for each (int i in foo()) {
13+
}
14+
}
15+
case (b) {
16+
x = false;
17+
}
18+
case (c) {
19+
x = false;
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)