aboutsummaryrefslogtreecommitdiff
path: root/src/armv7.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-09-26 00:40:03 -0700
committeriximeow <me@iximeow.net>2021-09-26 00:40:03 -0700
commit23bd0b37482a127c8f954ce7e068a507b9c1e09e (patch)
tree634a991f40463f9a1c50b75f5cf4b5ba6e4ef7c0 /src/armv7.rs
parent7fee2c5dafb84ee93ddb6a8f582e99d445c82677 (diff)
fix unimplemented code paths panicking as unreachable
only in a64 decoding really; there wasn't an "Incomplete" error at the time, but now there is.
Diffstat (limited to 'src/armv7.rs')
-rw-r--r--src/armv7.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/armv7.rs b/src/armv7.rs
index 64c9a4d..5894bc4 100644
--- a/src/armv7.rs
+++ b/src/armv7.rs
@@ -2280,7 +2280,7 @@ impl Decoder<ARMv7> for InstDecoder {
}
}
_ => {
- unreachable!();
+ unreachable!("op1 is two bits");
}
}
} else {
@@ -2405,7 +2405,7 @@ impl Decoder<ARMv7> for InstDecoder {
Operand::Reg(Reg::from_u8(R[1])),
];
}
- _ => { unreachable!("mul upcode: {:x}", op) }
+ _ => { unreachable!("mul opcode is only three bits, got: {:x}", op) }
}
} else {
// |c o n d|0 0 0 u|x x x x x x x x x x x x x x x x|1 u u 1|x x x x|
@@ -2894,7 +2894,7 @@ impl Decoder<ARMv7> for InstDecoder {
_ => { unreachable!("impossible bit pattern"); }
}
}
- _ => { unreachable!(); }
+ _ => { unreachable!("op is two bits"); }
}
}
} else {
@@ -3004,7 +3004,7 @@ impl Decoder<ARMv7> for InstDecoder {
inst.operands[3] = Operand::Nothing;
}
_ => {
- unreachable!();
+ unreachable!("opcode is masked to two bits here");
}
}
}
@@ -3248,7 +3248,7 @@ impl Decoder<ARMv7> for InstDecoder {
return Ok(());
}
_ => {
- unreachable!();
+ unreachable!("word masked to two bits");
}
}
}
@@ -3695,7 +3695,7 @@ impl Decoder<ARMv7> for InstDecoder {
// low bit of 0b110 or 0b111 corresponds to high bit of op1
return Err(DecodeError::Incomplete);
},
- _ => { unreachable!(); }
+ _ => { unreachable!("opc category is three bits"); }
}
Ok(())
}