Skip to content

Commit 6a78005

Browse files
committed
Make trans_anon_obj properly thread its bcx
Closes #893 Unfortunately, anon objs are still so broken as to be useless (fields don't work).
1 parent e4c91fd commit 6a78005

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/comp/middle/trans_objects.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,10 @@ fn trans_anon_obj(bcx: @block_ctxt, sp: span, anon_obj: ast::anon_obj,
367367
// If inner_obj (the object being extended) exists, translate it.
368368
// Translating inner_obj returns a ValueRef (pointer to a 2-word
369369
// value) wrapped in a result.
370-
let inner_obj_val: result = trans_temp_expr(bcx, e);
371-
372370
check type_is_tup_like(bcx, body_ty);
373-
let body_inner_obj =
374-
GEP_tup_like(bcx, body_ty, body,
375-
[0, abi::obj_body_elt_inner_obj]);
376-
bcx = body_inner_obj.bcx;
377-
bcx =
378-
copy_val(bcx, INIT, body_inner_obj.val, inner_obj_val.val,
379-
inner_obj_ty);
371+
let {bcx: cx, val: body_inner_obj} = GEP_tup_like
372+
(bcx, body_ty, body, [0, abi::obj_body_elt_inner_obj]);
373+
bcx = trans_expr(cx, e, save_in(body_inner_obj));
380374
}
381375
}
382376
revoke_clean(bcx, box);

0 commit comments

Comments
 (0)