summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-09-21 10:54:56 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-09-21 10:55:27 -0700
commitfcd17731cf7e27bcc7abb24b0aefb9d3dce15ed3 (patch)
tree046ae8efc68be6236b67d5afd888c45389dcc012 /src/comp
parenta034f87146e60e1db2327c6f6807c47406a1bb0b (diff)
downloadrust-fcd17731cf7e27bcc7abb24b0aefb9d3dce15ed3.tar.gz
rust-fcd17731cf7e27bcc7abb24b0aefb9d3dce15ed3.zip
rustc: Don't try to spill bottom types, since we can't make any assumptions about the type of the ValueRef
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index bb9c41d9366..0f48df3bdbd 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -4312,6 +4312,11 @@ fn type_is_immediate(ccx: @crate_ctxt, t: ty::t) -> bool {
 fn do_spill(cx: @block_ctxt, v: ValueRef, t: ty::t) -> result {
     // We have a value but we have to spill it, and root it, to pass by alias.
     let bcx = cx;
+
+    if ty::type_is_bot(bcx_tcx(bcx), t) {
+        ret rslt(bcx, C_null(T_ptr(T_i8())));
+    }
+
     let r = alloc_ty(bcx, t);
     bcx = r.bcx;
     let llptr = r.val;