diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-02-20 21:58:55 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-11-06 16:10:47 -0500 |
| commit | 4108964609171327618627477163339656037111 (patch) | |
| tree | 79f4c6da6394b973cee05cc42b6edd7e2e20909d /rust/src | |
| parent | b270d7ebe1e2a406e1f7f14807987d24b0c4a846 (diff) | |
Type Containers
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/types.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index 17bf96ae..5c568142 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -29,6 +29,7 @@ use crate::{ }; use lazy_static::lazy_static; +use std::ptr::null_mut; use std::{ borrow::Cow, collections::HashSet, @@ -1227,10 +1228,11 @@ impl fmt::Debug for Type { if let Ok(lock) = TYPE_DEBUG_BV.lock() { if let Some(bv) = &*lock { let mut count: usize = 0; + let container = unsafe { BNGetAnalysisTypeContainer(bv.handle) }; let lines: *mut BNTypeDefinitionLine = unsafe { BNGetTypeLines( self.handle, - bv.handle, + container, "".as_ptr() as *const c_char, 80, false, @@ -1238,6 +1240,9 @@ impl fmt::Debug for Type { &mut count as *mut usize, ) }; + unsafe { + BNFreeTypeContainer(container); + } if lines.is_null() { return Err(fmt::Error); @@ -2364,7 +2369,7 @@ impl CoreArrayProvider for QualifiedNameAndType { } unsafe impl CoreOwnedArrayProvider for QualifiedNameAndType { unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { - BNFreeTypeList(raw, count); + BNFreeTypeAndNameList(raw, count); } } |
