Skip to content

Commit

Permalink
Do not try to save block result when the block is an iter body
Browse files Browse the repository at this point in the history
Closes #791
  • Loading branch information
marijnh committed Aug 2, 2011
1 parent 6c9b90d commit 78a0d38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/comp/middle/trans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6534,7 +6534,8 @@ fn trans_closure(bcx_maybe: &option::t[@block_ctxt],
// (trans_block, trans_expr, et cetera).
let rslt =
if !ty::type_is_nil(cx.ccx.tcx, block_ty) &&
!ty::type_is_bot(cx.ccx.tcx, block_ty) {
!ty::type_is_bot(cx.ccx.tcx, block_ty) &&
f.proto != ast::proto_iter {
trans_block(bcx, f.body, save_in(fcx.llretptr))
} else { trans_block(bcx, f.body, return) };
bcx = rslt.bcx;
Expand Down

0 comments on commit 78a0d38

Please sign in to comment.