The cleanup scope of for loop bindings should translated when
popped to ensure resources are not leaked.
This commit is contained in:
Brian Koropoff 2014-09-13 15:35:21 -07:00
parent ccae356ace
commit 5857ec6d78

View File

@ -357,7 +357,10 @@ pub fn trans_for<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
// Codegen the body.
body_bcx_out = trans_block(body_bcx_out, body, expr::Ignore);
body_bcx_out.fcx.pop_custom_cleanup_scope(binding_cleanup_scope);
body_bcx_out =
body_bcx_out.fcx
.pop_and_trans_custom_cleanup_scope(body_bcx_out,
binding_cleanup_scope);
body_bcx_out =
body_bcx_out.fcx
.pop_and_trans_custom_cleanup_scope(body_bcx_out,