Call get_switch_int_data on a block with SwitchInt terminator

Fix a mix-up of a block with its predecessors in handling of SwitchInt
edge effects for backward analysis. Note that this functionality is
currently unused, so change has no practical impact.
This commit is contained in:
Tomasz Miąsko
2025-07-11 08:10:16 +02:00
parent cdac44e608
commit 011d4aa81f

View File

@@ -113,7 +113,7 @@ impl Direction for Backward {
}
mir::TerminatorKind::SwitchInt { ref targets, ref discr } => {
if let Some(mut data) = analysis.get_switch_int_data(block, discr) {
if let Some(mut data) = analysis.get_switch_int_data(pred, discr) {
let mut tmp = analysis.bottom_value(body);
for &value in &body.basic_blocks.switch_sources()[&(block, pred)] {
tmp.clone_from(exit_state);