Skip to content

Commit fcd1773

Browse files
committed
rustc: Don't try to spill bottom types, since we can't make any assumptions about the type of the ValueRef
1 parent a034f87 commit fcd1773

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,6 +4312,11 @@ fn type_is_immediate(ccx: @crate_ctxt, t: ty::t) -> bool {
43124312
fn do_spill(cx: @block_ctxt, v: ValueRef, t: ty::t) -> result {
43134313
// We have a value but we have to spill it, and root it, to pass by alias.
43144314
let bcx = cx;
4315+
4316+
if ty::type_is_bot(bcx_tcx(bcx), t) {
4317+
ret rslt(bcx, C_null(T_ptr(T_i8())));
4318+
}
4319+
43154320
let r = alloc_ty(bcx, t);
43164321
bcx = r.bcx;
43174322
let llptr = r.val;

0 commit comments

Comments
 (0)