Skip to content

Commit

Permalink
Fix a bug where StorageIgnored had an incorrect buffer length
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Sep 13, 2017
1 parent a2b3e08 commit 0e8e659
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ fn locals_live_across_suspend_points<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
dataflow::do_dataflow(tcx, mir, node_id, &[], &dead_unwinds, analysis,
|bd, p| &bd.mir().local_decls[p]);

let mut ignored = StorageIgnored(IdxSetBuf::new_filled(mir.basic_blocks().len()));
let mut ignored = StorageIgnored(IdxSetBuf::new_filled(mir.local_decls.len()));
ignored.visit_mir(mir);

let mut set = liveness::LocalSet::new_empty(mir.local_decls.len());
Expand All @@ -365,7 +365,7 @@ fn locals_live_across_suspend_points<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

let mut live_locals = storage_liveness;

// Mark locals without storage statements as always live
// Mark locals without storage statements as always having live storage
live_locals.union(&ignored.0);

// Locals live are live at this point only if they are used across suspension points
Expand Down

0 comments on commit 0e8e659

Please sign in to comment.