Skip to content

EntryOptions::stack_index panics when stack index is not set (when Debug is called on EntryOptions) #550

@ChocolateLoverRaj

Description

@ChocolateLoverRaj
fn stack_index(&self) -> u16 {
    self.bits.get_bits(0..3) - 1
}

Here the - 1 causes a "attempt to subtract with overflow" error.

It's very easy to reproduce a panic:

log::info!("IDT: {:#?}", idt);

Probably caused by the +1 -1 translation stuff but I don't really understand why the translation is there and how the IDT encoding works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions