summaryrefslogtreecommitdiff
path: root/rust/src/variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/variable.rs')
-rw-r--r--rust/src/variable.rs30
1 files changed, 23 insertions, 7 deletions
diff --git a/rust/src/variable.rs b/rust/src/variable.rs
index d224a45b..fe833f97 100644
--- a/rust/src/variable.rs
+++ b/rust/src/variable.rs
@@ -8,13 +8,13 @@ use crate::string::{raw_to_string, BnString};
use crate::types::Type;
use binaryninjacore_sys::{
BNDataVariable, BNDataVariableAndName, BNFreeDataVariableAndName, BNFreeDataVariables,
- BNFreeILInstructionList, BNFreeIndirectBranchList, BNFreeMergedVariableList,
- BNFreePossibleValueSet, BNFreeStackVariableReferenceList, BNFreeUserVariableValues,
- BNFreeVariableList, BNFreeVariableNameAndTypeList, BNFromVariableIdentifier,
- BNIndirectBranchInfo, BNLookupTableEntry, BNMergedVariable, BNPossibleValueSet,
- BNRegisterValue, BNRegisterValueType, BNStackVariableReference, BNToVariableIdentifier,
- BNTypeWithConfidence, BNUserVariableValue, BNValueRange, BNVariable, BNVariableNameAndType,
- BNVariableSourceType,
+ BNFreeDataVariablesAndName, BNFreeILInstructionList, BNFreeIndirectBranchList,
+ BNFreeMergedVariableList, BNFreePossibleValueSet, BNFreeStackVariableReferenceList,
+ BNFreeUserVariableValues, BNFreeVariableList, BNFreeVariableNameAndTypeList,
+ BNFromVariableIdentifier, BNIndirectBranchInfo, BNLookupTableEntry, BNMergedVariable,
+ BNPossibleValueSet, BNRegisterValue, BNRegisterValueType, BNStackVariableReference,
+ BNToVariableIdentifier, BNTypeWithConfidence, BNUserVariableValue, BNValueRange, BNVariable,
+ BNVariableNameAndType, BNVariableSourceType,
};
use std::collections::HashSet;
@@ -147,6 +147,22 @@ impl NamedDataVariableWithType {
}
}
+impl CoreArrayProvider for NamedDataVariableWithType {
+ type Raw = BNDataVariableAndName;
+ type Context = ();
+ type Wrapped<'a> = NamedDataVariableWithType;
+}
+
+unsafe impl CoreArrayProviderInner for NamedDataVariableWithType {
+ unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) {
+ BNFreeDataVariablesAndName(raw, count)
+ }
+
+ unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> {
+ Self::from_raw(raw)
+ }
+}
+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct NamedVariableWithType {
pub variable: Variable,