Skip to content

Commit dc62de7

Browse files
committed
IDT: Fix range for Index and IndexMut
Make case #CP (21) reachable for Index and IndexMut implementations. Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
1 parent 6d593d8 commit dc62de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/structures/idt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ impl Index<usize> for InterruptDescriptorTable {
589589
20 => &self.virtualization,
590590
28 => &self.hv_injection_exception,
591591
i @ 32..=255 => &self.interrupts[i - 32],
592-
i @ 15 | i @ 31 | i @ 21..=27 => panic!("entry {} is reserved", i),
592+
i @ 15 | i @ 31 | i @ 22..=27 => panic!("entry {} is reserved", i),
593593
i @ 8 | i @ 10..=14 | i @ 17 | i @ 21 | i @ 29 | i @ 30 => {
594594
panic!("entry {} is an exception with error code", i)
595595
}
@@ -621,7 +621,7 @@ impl IndexMut<usize> for InterruptDescriptorTable {
621621
20 => &mut self.virtualization,
622622
28 => &mut self.hv_injection_exception,
623623
i @ 32..=255 => &mut self.interrupts[i - 32],
624-
i @ 15 | i @ 31 | i @ 21..=27 => panic!("entry {} is reserved", i),
624+
i @ 15 | i @ 31 | i @ 22..=27 => panic!("entry {} is reserved", i),
625625
i @ 8 | i @ 10..=14 | i @ 17 | i @ 21 | i @ 29 | i @ 30 => {
626626
panic!("entry {} is an exception with error code", i)
627627
}

0 commit comments

Comments
 (0)