From 0504f759cadb643d50e4eee6e9372d98dd3ac245 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 20 Jul 2019 10:55:58 -0700 Subject: these types SHOULD be representable with one byte --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 24f4299..82a1e48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -213,6 +213,7 @@ impl Operand { #[cfg(feature="use-serde")] #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)] +#[repr(u8)] pub enum RegisterBank { Q, D, W, B, rB, // Quadword, Dword, Word, Byte CR, DR, S, EIP, RIP, EFlags, RFlags, // Control reg, Debug reg, Selector, ... @@ -222,6 +223,7 @@ pub enum RegisterBank { #[allow(non_camel_case_types)] #[cfg(not(feature="use-serde"))] #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] +#[repr(u8)] pub enum RegisterBank { Q, D, W, B, rB, // Quadword, Dword, Word, Byte CR, DR, S, EIP, RIP, EFlags, RFlags, // Control reg, Debug reg, Selector, ... @@ -230,12 +232,14 @@ pub enum RegisterBank { } #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] +#[repr(u8)] pub enum Segment { CS, DS, ES, FS, GS, SS } #[allow(non_camel_case_types)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[repr(u8)] pub enum Opcode { XADD, BT, -- cgit v1.1