diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-12-19 22:39:11 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 11:02:14 -0700 |
| commit | 0748dfe65398f17064ed744a3d198f144d0aa2c5 (patch) | |
| tree | adde2cf25a4b9812c8322ed326f361b23c1681e5 /rust/src/types.rs | |
| parent | e9e5c3e3568351e99c5034e49ae21f0b8d12a4c2 (diff) | |
Support intrinsics in Rust architecture plugins
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 13 |
1 files changed, 12 insertions, 1 deletions
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<S: BnStrCompatible> { pub name: S, - t: Conf<Ref<Type>>, + pub t: Conf<Ref<Type>>, } impl NameAndType<String> { @@ -2467,6 +2467,17 @@ impl<S: BnStrCompatible> NameAndType<S> { } } + 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<Ref<Type>> { self.t.clone() } |
