Skip to content

Commit 1e988f2

Browse files
committed
Don't call trans_bind_thunk in an unreachable context
Closes #973
1 parent 4c5e42a commit 1e988f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,6 +3596,10 @@ fn trans_bind_1(cx: @block_ctxt, outgoing_fty: ty::t,
35963596
bound_vals += [lv];
35973597
bound_tys += [ty::expr_ty(bcx_tcx(cx), e)];
35983598
}
3599+
if bcx.unreachable {
3600+
ret rslt(bcx, llvm::LLVMGetUndef(
3601+
T_ptr(type_of_or_i8(bcx, outgoing_fty))));
3602+
}
35993603

36003604
// Actually construct the closure
36013605
let closure =

0 commit comments

Comments
 (0)