Skip to content

Commit 0e8e659

Browse files
committed
Fix a bug where StorageIgnored had an incorrect buffer length
1 parent a2b3e08 commit 0e8e659

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/transform/generator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ fn locals_live_across_suspend_points<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
343343
dataflow::do_dataflow(tcx, mir, node_id, &[], &dead_unwinds, analysis,
344344
|bd, p| &bd.mir().local_decls[p]);
345345

346-
let mut ignored = StorageIgnored(IdxSetBuf::new_filled(mir.basic_blocks().len()));
346+
let mut ignored = StorageIgnored(IdxSetBuf::new_filled(mir.local_decls.len()));
347347
ignored.visit_mir(mir);
348348

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

366366
let mut live_locals = storage_liveness;
367367

368-
// Mark locals without storage statements as always live
368+
// Mark locals without storage statements as always having live storage
369369
live_locals.union(&ignored.0);
370370

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

0 commit comments

Comments
 (0)