Skip to content

Commit 011d4aa

Browse files
committed
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.
1 parent cdac44e commit 011d4aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_dataflow/src/framework/direction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Direction for Backward {
113113
}
114114

115115
mir::TerminatorKind::SwitchInt { ref targets, ref discr } => {
116-
if let Some(mut data) = analysis.get_switch_int_data(block, discr) {
116+
if let Some(mut data) = analysis.get_switch_int_data(pred, discr) {
117117
let mut tmp = analysis.bottom_value(body);
118118
for &value in &body.basic_blocks.switch_sources()[&(block, pred)] {
119119
tmp.clone_from(exit_state);

0 commit comments

Comments
 (0)