Skip to content

Commit 61a9615

Browse files
committed
---
yaml --- r: 1201 b: refs/heads/master c: 27b4c3f h: refs/heads/master i: 1199: 434a7bc v: v3
1 parent 791349a commit 61a9615

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
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: fb8eff95e2ae88206867366971e02cbb7d95b62d
2+
refs/heads/master: 27b4c3f96231099c32c789a8671632f78431bb69

trunk/src/comp/middle/trans.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,8 +1990,7 @@ impure fn trans_bind(@block_ctxt cx, @ast.expr f,
19901990

19911991
// Synthesize a closure type.
19921992
let @ty.t bindings_ty = ty.plain_ty(ty.ty_tup(bound_tys));
1993-
let TypeRef llbindings_ty = type_of(bcx.fcx.ccx,
1994-
bindings_ty);
1993+
let TypeRef llbindings_ty = type_of(bcx.fcx.ccx, bindings_ty);
19951994
let TypeRef llclosure_ty =
19961995
T_ptr(T_box(T_struct(vec(T_ptr(T_tydesc()),
19971996
type_of(bcx.fcx.ccx,
@@ -2013,23 +2012,27 @@ impure fn trans_bind(@block_ctxt cx, @ast.expr f,
20132012
C_int(abi.box_rc_field_body)));
20142013
bcx.build.Store(C_int(1), rc);
20152014

2016-
20172015
// Store bindings tydesc.
20182016
auto bound_tydesc =
20192017
bcx.build.GEP(closure,
20202018
vec(C_int(0),
20212019
C_int(abi.closure_elt_tydesc)));
2022-
20232020
auto bindings_tydesc = get_tydesc(bcx, bindings_ty);
20242021
bcx.build.Store(bindings_tydesc, bound_tydesc);
20252022

2026-
// Copy args into body fields.
2027-
auto bindings =
2023+
// Store thunk-target.
2024+
auto bound_target =
20282025
bcx.build.GEP(closure,
20292026
vec(C_int(0),
2030-
C_int(abi.closure_elt_bindings)));
2027+
C_int(abi.closure_elt_target)));
2028+
bcx.build.Store(bcx.build.Load(f_res.res.val), bound_target);
20312029

2030+
// Copy expr values into boxed bindings.
20322031
let int i = 0;
2032+
auto bindings =
2033+
bcx.build.GEP(closure,
2034+
vec(C_int(0),
2035+
C_int(abi.closure_elt_bindings)));
20332036
for (ValueRef v in bound_vals) {
20342037
auto bound = bcx.build.GEP(bindings,
20352038
vec(C_int(0),C_int(i)));

0 commit comments

Comments
 (0)