diff options
Diffstat (limited to 'rust/src/architecture.rs')
| -rw-r--r-- | rust/src/architecture.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 713e8bf1..6831844e 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -715,6 +715,21 @@ impl Register for CoreRegister { } } +impl CoreArrayProvider for CoreRegister { + type Raw = u32; + type Context = CoreArchitecture; + type Wrapped<'a> = Self; +} + +unsafe impl CoreArrayProviderInner for CoreRegister { + unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { + BNFreeRegisterList(raw) + } + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, context: &'a Self::Context) -> Self::Wrapped<'a> { + Self(context.0, *raw) + } +} + pub struct CoreRegisterStackInfo(*mut BNArchitecture, BNRegisterStackInfo); impl RegisterStackInfo for CoreRegisterStackInfo { @@ -2419,7 +2434,10 @@ where }; let inputs = intrinsic.inputs(); - let mut res: Box<[_]> = inputs.into_iter().map(|input| unsafe { Ref::into_raw(input) }.0).collect(); + let mut res: Box<[_]> = inputs + .into_iter() + .map(|input| unsafe { Ref::into_raw(input) }.0) + .collect(); unsafe { *count = res.len(); |
