Merge pull request #3826 from jdm/doublefail
Fix ICE stemming from use of unique pointers in unreachable blocks.
This commit is contained in:
commit
2eea07be11
@ -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)
|
||||
}
|
||||
|
5
src/test/run-fail/doublefail.rs
Normal file
5
src/test/run-fail/doublefail.rs
Normal file
@ -0,0 +1,5 @@
|
||||
//error-pattern:One
|
||||
fn main() {
|
||||
fail ~"One";
|
||||
fail ~"Two";
|
||||
}
|
Loading…
Reference in New Issue
Block a user