diff --git a/src/architecture.rs b/src/architecture.rs index 259a19c..ab392a3 100644 --- a/src/architecture.rs +++ b/src/architecture.rs @@ -364,10 +364,7 @@ impl Architecture for Msp430 { fn register_from_id(&self, id: u32) -> Option { match id.try_into() { Ok(register) => Some(register), - Err(_) => { - error!("invalid register id {}", id); - None - } + Err(_) => None, } } diff --git a/src/register.rs b/src/register.rs index eba29c6..20a5dff 100644 --- a/src/register.rs +++ b/src/register.rs @@ -27,6 +27,10 @@ impl TryFrom for Register { type Error = (); fn try_from(id: u32) -> Result { + // TODO: we should return separate errors if the id is between 0x7fff_ffff and 0xffff_ffff + // vs outside of that range. Temporary registers have have the high bit set which we + // shouldn't get, unless there is a bug in core. An id that isn't within that range but we + // don't handle is a bug in the architecture. match id { 0 => Ok(Self::Pc), 1 => Ok(Self::Sp),