Skip to content

Commit

Permalink
fix(idt): panic in impl fmt::Debug for EntryOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Dec 24, 2024
1 parent 8ca2ab9 commit adabd05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/structures/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ impl EntryOptions {
self
}

fn stack_index(&self) -> u16 {
self.bits.get_bits(0..3) - 1
fn stack_index(&self) -> Option<u16> {
self.bits.get_bits(0..3).checked_sub(1)
}
}

Expand Down Expand Up @@ -1720,6 +1720,11 @@ mod test {
}
}

#[test]
fn idt_fmt_debug() {
dbg!(InterruptDescriptorTable::new());
}

#[test]
fn entry_derive_test() {
fn foo(_: impl Copy + PartialEq + fmt::Debug) {}
Expand Down

0 comments on commit adabd05

Please sign in to comment.