rust-x86asm icon indicating copy to clipboard operation
rust-x86asm copied to clipboard

Reading can panic on invalid operands

Open ExpHP opened this issue 5 years ago • 0 comments

fn main() {
    println!("{:?}", x86asm::InstructionReader::new(
        &[0x6c, 0x90][..],
        x86asm::Mode::Protected,
    ).read());
}
thread 'main' panicked at 'Invalid operand definition.', C:\Users\diago\.cargo\registry\src\github.com-1ecc6299db9ec823\x86asm-0.1.0\src\decoding.rs:322:26

It's not entirely clear to me why this panics, rather than returning Err.

ExpHP avatar Jan 05 '20 01:01 ExpHP