Skip to content

Commit 0a01144

Browse files
committed
Use trans_expr_save_in instead of trans_expr when appropriate
This guards against passing a save_in destination to nil or bot-typed things.
1 parent 06257d6 commit 0a01144

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4272,7 +4272,7 @@ fn trans_temp_lval(bcx: @block_ctxt, e: @ast::expr) -> lval_result {
42724272
ret {bcx: bcx, val: *cell, kind: temporary};
42734273
} else {
42744274
let {bcx, val: scratch} = alloc_ty(bcx, ty);
4275-
bcx = trans_expr(bcx, e, save_in(scratch));
4275+
bcx = trans_expr_save_in(bcx, e, scratch);
42764276
add_clean_temp(bcx, scratch, ty);
42774277
ret {bcx: bcx, val: scratch, kind: temporary};
42784278
}

src/comp/middle/trans_objects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ fn trans_anon_obj(bcx: @block_ctxt, sp: span, anon_obj: ast::anon_obj,
370370
check type_is_tup_like(bcx, body_ty);
371371
let {bcx: cx, val: body_inner_obj} = GEP_tup_like
372372
(bcx, body_ty, body, [0, abi::obj_body_elt_inner_obj]);
373-
bcx = trans_expr(cx, e, save_in(body_inner_obj));
373+
bcx = trans_expr_save_in(cx, e, body_inner_obj);
374374
}
375375
}
376376
revoke_clean(bcx, box);

0 commit comments

Comments
 (0)