Don't call trans_bind_thunk in an unreachable context

Closes #973
This commit is contained in:
Marijn Haverbeke 2011-09-26 04:08:45 +02:00
parent 4c5e42a139
commit 1e988f228d

View File

@ -3596,6 +3596,10 @@ fn trans_bind_1(cx: @block_ctxt, outgoing_fty: ty::t,
bound_vals += [lv];
bound_tys += [ty::expr_ty(bcx_tcx(cx), e)];
}
if bcx.unreachable {
ret rslt(bcx, llvm::LLVMGetUndef(
T_ptr(type_of_or_i8(bcx, outgoing_fty))));
}
// Actually construct the closure
let closure =