summaryrefslogtreecommitdiff
path: root/rust/src/llil/function.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-10-26 20:33:45 -0400
committerMason Reed <mason@vector35.com>2024-10-26 20:33:45 -0400
commit952d16ca58429d126224662f4f5f496a0535c7ac (patch)
tree82583dcbf8349d2678f7a8762346a493571070ae /rust/src/llil/function.rs
parent4864ede6684833163153343b9604619c7e7a5dd6 (diff)
Fix all low level il function getters leaking in rust
Diffstat (limited to 'rust/src/llil/function.rs')
-rw-r--r--rust/src/llil/function.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/rust/src/llil/function.rs b/rust/src/llil/function.rs
index 8f1eac62..abc501e5 100644
--- a/rust/src/llil/function.rs
+++ b/rust/src/llil/function.rs
@@ -84,10 +84,7 @@ where
M: FunctionMutability,
F: FunctionForm,
{
- pub(crate) unsafe fn from_raw(
- borrower: A::Handle,
- handle: *mut BNLowLevelILFunction,
- ) -> Ref<Self> {
+ pub(crate) unsafe fn from_raw(borrower: A::Handle, handle: *mut BNLowLevelILFunction) -> Self {
debug_assert!(!handle.is_null());
Self {
@@ -97,7 +94,13 @@ where
_mutability: PhantomData,
_form: PhantomData,
}
- .to_owned()
+ }
+
+ pub(crate) unsafe fn ref_from_raw(
+ borrower: A::Handle,
+ handle: *mut BNLowLevelILFunction,
+ ) -> Ref<Self> {
+ Ref::new(Self::from_raw(borrower, handle))
}
pub(crate) fn arch(&self) -> &A {