diff options
Diffstat (limited to 'rust/src/confidence.rs')
| -rw-r--r-- | rust/src/confidence.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/rust/src/confidence.rs b/rust/src/confidence.rs index f8745180..31ce7582 100644 --- a/rust/src/confidence.rs +++ b/rust/src/confidence.rs @@ -3,11 +3,11 @@ use crate::architecture::{Architecture, CoreArchitecture}; use crate::calling_convention::CoreCallingConvention; use crate::rc::{Ref, RefCountable}; -use crate::types::Type; +use crate::types::{Type, ValueLocation}; use binaryninjacore_sys::{ BNBoolWithConfidence, BNCallingConventionWithConfidence, BNGetCallingConventionArchitecture, BNInlineDuringAnalysis, BNInlineDuringAnalysisWithConfidence, BNOffsetWithConfidence, - BNTypeWithConfidence, + BNTypeWithConfidence, BNValueLocation, BNValueLocationWithConfidence, }; use std::fmt; use std::fmt::{Debug, Display, Formatter}; @@ -225,6 +225,19 @@ impl Conf<Ref<Type>> { } } +impl Conf<ValueLocation> { + pub(crate) fn into_rust_raw(value: Self) -> BNValueLocationWithConfidence { + BNValueLocationWithConfidence { + location: ValueLocation::into_rust_raw(&value.contents), + confidence: value.confidence, + } + } + + pub(crate) fn free_rust_raw(value: BNValueLocationWithConfidence) { + ValueLocation::free_rust_raw(value.location); + } +} + impl Conf<Ref<CoreCallingConvention>> { pub(crate) fn from_raw(value: &BNCallingConventionWithConfidence) -> Self { let arch = unsafe { |
