diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-09-13 23:27:40 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-09-13 23:28:11 +0200 |
| commit | 0e8e6592f6650f975fc39bfcdef53ce474c1e7a9 (patch) | |
| tree | 2997feaa5cf4dea5ef50afbeaad8ea3adeb15826 /src/librustc_mir/transform | |
| parent | a2b3e0889f7bfac7ae4962bc645b082805918a34 (diff) | |
| download | rust-0e8e6592f6650f975fc39bfcdef53ce474c1e7a9.tar.gz rust-0e8e6592f6650f975fc39bfcdef53ce474c1e7a9.zip | |
Fix a bug where StorageIgnored had an incorrect buffer length
Diffstat (limited to 'src/librustc_mir/transform')
| -rw-r--r-- | src/librustc_mir/transform/generator.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index 4aee97d05f2..78fe7b26ebf 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -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()); @@ -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 |
