Skip to content

Commit c4dc831

Browse files
committed
---
yaml --- r: 3449 b: refs/heads/master c: 7b5d34a h: refs/heads/master i: 3447: 1b3fe86 v: v3
1 parent 36330f7 commit c4dc831

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
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: 57e5cde3a2e19c8bd6616b273421c09b075b7222
2+
refs/heads/master: 7b5d34aa9ac5c82e08c82b6e865c3b697299f65d

trunk/src/comp/middle/trans.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5135,6 +5135,13 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty,
51355135
auto fcx = new_fn_ctxt(cx, sp, llthunk);
51365136
auto bcx = new_top_block_ctxt(fcx);
51375137
auto lltop = bcx.llbb;
5138+
5139+
// The 'llenv' that will arrive in the thunk we're creating is an
5140+
// environment that will contain the values of its arguments and a pointer
5141+
// to the original function. So, let's create one of those:
5142+
5143+
// The llenv pointer needs to be the correct size. That size is
5144+
// 'closure_ty', which was determined by trans_bind.
51385145
auto llclosure_ptr_ty =
51395146
type_of(cx.ccx, sp, ty::mk_imm_box(cx.ccx.tcx, closure_ty));
51405147
auto llclosure = bcx.build.PointerCast(fcx.llenv, llclosure_ptr_ty);
@@ -5296,14 +5303,12 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
52965303
// Translate the bound expressions.
52975304
let vec[ty::t] bound_tys = [];
52985305
let vec[ValueRef] bound_vals = [];
5299-
auto i = 0u;
53005306
for (@ast::expr e in bound) {
53015307
auto arg = trans_expr(bcx, e);
53025308
bcx = arg.bcx;
53035309
vec::push[ValueRef](bound_vals, arg.val);
53045310
vec::push[ty::t](bound_tys,
53055311
ty::expr_ty(cx.fcx.lcx.ccx.tcx, e));
5306-
i += 1u;
53075312
}
53085313

53095314
// Synthesize a closure type.
@@ -5384,9 +5389,9 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
53845389
auto src = bcx.build.Load(f_res.res.val);
53855390
bound_target = bcx.build.PointerCast(bound_target, llclosurety);
53865391
bcx.build.Store(src, bound_target);
5387-
// Copy expr values into boxed bindings.
53885392

5389-
i = 0u;
5393+
// Copy expr values into boxed bindings.
5394+
auto i = 0u;
53905395
auto bindings =
53915396
bcx.build.GEP(closure,
53925397
[C_int(0), C_int(abi::closure_elt_bindings)]);

0 commit comments

Comments
 (0)