aboutsummaryrefslogtreecommitdiff
path: root/src/protected_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/protected_mode')
-rw-r--r--src/protected_mode/display.rs5
-rw-r--r--src/protected_mode/mod.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/protected_mode/display.rs b/src/protected_mode/display.rs
index f545111..c2b52eb 100644
--- a/src/protected_mode/display.rs
+++ b/src/protected_mode/display.rs
@@ -1,4 +1,5 @@
use core::fmt;
+use crate::safer_unchecked::GetSaferUnchecked as _;
use yaxpeax_arch::{Colorize, ShowContextual, NoColors, YaxColors};
use yaxpeax_arch::display::*;
@@ -123,7 +124,7 @@ const REG_NAMES: &[&'static str] = &[
];
pub(crate) fn regspec_label(spec: &RegSpec) -> &'static str {
- unsafe { REG_NAMES.get_unchecked((spec.num as u16 + ((spec.bank as u16) << 3)) as usize) }
+ unsafe { REG_NAMES.get_kinda_unchecked((spec.num as u16 + ((spec.bank as u16) << 3)) as usize) }
}
impl fmt::Display for RegSpec {
@@ -1811,7 +1812,7 @@ const MNEMONICS: &[&'static str] = &[
impl Opcode {
fn name(&self) -> &'static str {
unsafe {
- MNEMONICS.get_unchecked(*self as usize)
+ MNEMONICS.get_kinda_unchecked(*self as usize)
}
}
}
diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs
index 040a23e..0a6fcf8 100644
--- a/src/protected_mode/mod.rs
+++ b/src/protected_mode/mod.rs
@@ -10,7 +10,7 @@ pub use crate::MemoryAccessSize;
pub use self::display::{DisplayStyle, InstructionDisplayer};
use core::cmp::PartialEq;
-use core::hint::unreachable_unchecked;
+use crate::safer_unchecked::unreachable_kinda_unchecked as unreachable_unchecked;
use yaxpeax_arch::{AddressDiff, Decoder, Reader, LengthedInstruction};
use yaxpeax_arch::annotation::{AnnotatingDecoder, DescriptionSink, NullSink};