Skip to content

Commit 7c79801

Browse files
committed
Fix ICE stemming from use of unique pointers in unreachable blocks.
1 parent 191d162 commit 7c79801

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/rustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 0 deletions
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)