diff options
| author | Rubens Brandao <git@rubens.io> | 2024-04-16 17:03:20 -0300 |
|---|---|---|
| committer | Rubens Brandao <git@rubens.io> | 2024-04-16 17:03:20 -0300 |
| commit | f3c1a3cb3cbdd25d5f556d1ab770f8cbc29fd567 (patch) | |
| tree | 71a6f2e8df93f7ef08bda08caca3a637588cc919 /rust/src/references.rs | |
| parent | 37b51462dcf26dc40ac5d7e82acdfd4cbe754157 (diff) | |
add guard to array with unbound return types
Diffstat (limited to 'rust/src/references.rs')
| -rw-r--r-- | rust/src/references.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rust/src/references.rs b/rust/src/references.rs index a30f3f5e..8b4ebb87 100644 --- a/rust/src/references.rs +++ b/rust/src/references.rs @@ -1,6 +1,6 @@ use crate::architecture::CoreArchitecture; use crate::function::Function; -use crate::rc::{CoreArrayProvider, CoreArrayWrapper, CoreOwnedArrayProvider, Ref}; +use crate::rc::{CoreArrayProvider, CoreArrayWrapper, CoreOwnedArrayProvider, Guard, Ref}; use binaryninjacore_sys::{BNFreeCodeReferences, BNFreeDataReferences, BNReferenceSource}; use std::mem::ManuallyDrop; @@ -65,12 +65,10 @@ unsafe impl CoreOwnedArrayProvider for CodeReference { } unsafe impl CoreArrayWrapper for CodeReference { - // TODO there is nothing blocking the returned value from out-living the - // array, change it to Guard? - type Wrapped<'a> = CodeReference; + type Wrapped<'a> = Guard<'a, CodeReference>; unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - CodeReference::new(raw) + Guard::new(CodeReference::new(raw), &()) } } |
