From 0748dfe65398f17064ed744a3d198f144d0aa2c5 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 19 Dec 2023 22:39:11 -0700 Subject: Support intrinsics in Rust architecture plugins --- rust/src/types.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'rust/src/types.rs') diff --git a/rust/src/types.rs b/rust/src/types.rs index d86ffc82..04cb93fc 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -2446,7 +2446,7 @@ unsafe impl<'a> CoreArrayWrapper<'a> for QualifiedNameTypeAndId { pub struct NameAndType { pub name: S, - t: Conf>, + pub t: Conf>, } impl NameAndType { @@ -2467,6 +2467,17 @@ impl NameAndType { } } + pub(crate) fn into_raw(self) -> BNNameAndType { + let t = self.t.clone(); + let res = BNNameAndType { + name: BnString::new(self.name).into_raw(), + type_: t.contents.handle, + typeConfidence: self.t.confidence, + }; + mem::forget(t); + res + } + pub fn type_with_confidence(&self) -> Conf> { self.t.clone() } -- cgit v1.3.1