From c21c5dbb75780e9d73d5886a50b2a320dc250fcf Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Tue, 24 Jun 2025 14:47:37 -0400 Subject: Temporary fix for Rust API. This...should probably not be done this way. But, at least we don't fail clippy now. --- rust/src/architecture.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'rust/src') diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 054c078b..3344b2af 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -471,14 +471,14 @@ pub trait Architecture: 'static + Sized + AsRef { il: &LowLevelILMutableFunction, ) -> Option<(usize, bool)>; - fn analyze_basic_blocks( + unsafe fn analyze_basic_blocks( &self, function: &mut Function, context: *mut BNBasicBlockAnalysisContext, ) { unsafe { BNArchitectureDefaultAnalyzeBasicBlocks(function.handle, context); - }; + } } /// Fallback flag value calculation path. This method is invoked when the core is unable to @@ -1544,14 +1544,14 @@ impl Architecture for CoreArchitecture { } } - fn analyze_basic_blocks( + unsafe fn analyze_basic_blocks( &self, function: &mut Function, context: *mut BNBasicBlockAnalysisContext, ) { unsafe { BNArchitectureAnalyzeBasicBlocks(self.handle, function.handle, context); - }; + } } fn flag_write_llil<'a>( @@ -2267,7 +2267,9 @@ where { let custom_arch = unsafe { &*(ctxt as *mut A) }; let mut function = unsafe { Function::from_raw(function) }; - custom_arch.analyze_basic_blocks(&mut function, context); + unsafe { + custom_arch.analyze_basic_blocks(&mut function, context); + } } extern "C" fn cb_reg_name(ctxt: *mut c_void, reg: u32) -> *mut c_char -- cgit v1.3.1