Merge pull request #3826 from jdm/doublefail

Fix ICE stemming from use of unique pointers in unreachable blocks.
This commit is contained in:
Brian Anderson 2012-10-22 11:32:30 -07:00
commit 2eea07be11
2 changed files with 6 additions and 1 deletions

View File

@ -267,7 +267,7 @@ fn malloc_raw_dyn(bcx: block, t: ty::t, heap: heap,
fn non_gc_box_cast(bcx: block, val: ValueRef) -> ValueRef {
debug!("non_gc_box_cast");
add_comment(bcx, ~"non_gc_box_cast");
assert(llvm::LLVMGetPointerAddressSpace(val_ty(val)) == gc_box_addrspace);
assert(llvm::LLVMGetPointerAddressSpace(val_ty(val)) == gc_box_addrspace || bcx.unreachable);
let non_gc_t = T_ptr(llvm::LLVMGetElementType(val_ty(val)));
PointerCast(bcx, val, non_gc_t)
}

View File

@ -0,0 +1,5 @@
//error-pattern:One
fn main() {
fail ~"One";
fail ~"Two";
}