Skip to content

Commit 2eea07b

Browse files
committed
Merge pull request #3826 from jdm/doublefail
Fix ICE stemming from use of unique pointers in unreachable blocks.
2 parents 14e7df7 + 7c79801 commit 2eea07b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/rustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn malloc_raw_dyn(bcx: block, t: ty::t, heap: heap,
267267
fn non_gc_box_cast(bcx: block, val: ValueRef) -> ValueRef {
268268
debug!("non_gc_box_cast");
269269
add_comment(bcx, ~"non_gc_box_cast");
270-
assert(llvm::LLVMGetPointerAddressSpace(val_ty(val)) == gc_box_addrspace);
270+
assert(llvm::LLVMGetPointerAddressSpace(val_ty(val)) == gc_box_addrspace || bcx.unreachable);
271271
let non_gc_t = T_ptr(llvm::LLVMGetElementType(val_ty(val)));
272272
PointerCast(bcx, val, non_gc_t)
273273
}

src/test/run-fail/doublefail.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//error-pattern:One
2+
fn main() {
3+
fail ~"One";
4+
fail ~"Two";
5+
}

0 commit comments

Comments
 (0)