Skip to content

Commit 52412ee

Browse files
committed
---
yaml --- r: 1726 b: refs/heads/master c: 8e597b2 h: refs/heads/master v: v3
1 parent 513d7b9 commit 52412ee

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-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: c710c9a1b81f9231b3227159c9655ac7a2a5e099
2+
refs/heads/master: 8e597b295f05bfad803baf9354af66af2d14585c

trunk/src/comp/middle/trans.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,12 @@ fn trans_for_each(@block_ctxt cx,
30023002
auto llbinding;
30033003
alt (cx.fcx.lllocals.find(did)) {
30043004
case (none[ValueRef]) {
3005-
llbinding = cx.fcx.llupvars.get(did);
3005+
alt (cx.fcx.llupvars.find(did)) {
3006+
case (none[ValueRef]) {
3007+
llbinding = cx.fcx.llargs.get(did);
3008+
}
3009+
case (some[ValueRef](?llval)) { llbinding = llval; }
3010+
}
30063011
}
30073012
case (some[ValueRef](?llval)) { llbinding = llval; }
30083013
}
@@ -3384,8 +3389,15 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
33843389
case (some[ast.def](?def)) {
33853390
alt (def) {
33863391
case (ast.def_arg(?did)) {
3387-
check (cx.fcx.llargs.contains_key(did));
3388-
ret lval_mem(cx, cx.fcx.llargs.get(did));
3392+
alt (cx.fcx.llargs.find(did)) {
3393+
case (none[ValueRef]) {
3394+
check (cx.fcx.llupvars.contains_key(did));
3395+
ret lval_mem(cx, cx.fcx.llupvars.get(did));
3396+
}
3397+
case (some[ValueRef](?llval)) {
3398+
ret lval_mem(cx, llval);
3399+
}
3400+
}
33893401
}
33903402
case (ast.def_local(?did)) {
33913403
alt (cx.fcx.lllocals.find(did)) {

0 commit comments

Comments
 (0)