Skip to content

Commit

Permalink
Change index for SwitchInt case
Browse files Browse the repository at this point in the history
The indices do not matter here, and this fixes an index out of bounds
panic when compiling a generator that can unwind but not return.
  • Loading branch information
jonas-schievink committed Mar 8, 2020
1 parent 46aeef6 commit 8d9f633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/generator.rs
Expand Up @@ -1108,7 +1108,7 @@ fn create_generator_resume_function<'tcx>(

if can_unwind {
cases.insert(
2,
1,
(POISONED, insert_panic_block(tcx, body, ResumedAfterPanic(generator_kind))),
);
}
Expand Down

0 comments on commit 8d9f633

Please sign in to comment.