Do not try to save block result when the block is an iter body

Closes #791
This commit is contained in:
Marijn Haverbeke 2011-08-02 14:28:32 +02:00
parent 6c9b90d06a
commit 78a0d380cc

View File

@ -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;