Skip to content

Commit 0d81e8c

Browse files
committed
Temporary fix for Rust API.
This...should probably not be done this way. But, at least we don't fail clippy now.
1 parent 235d2d9 commit 0d81e8c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

rust/src/architecture.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,14 @@ pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
471471
il: &LowLevelILMutableFunction,
472472
) -> Option<(usize, bool)>;
473473

474-
fn analyze_basic_blocks(
474+
unsafe fn analyze_basic_blocks(
475475
&self,
476476
function: &mut Function,
477477
context: *mut BNBasicBlockAnalysisContext,
478478
) {
479479
unsafe {
480480
BNArchitectureDefaultAnalyzeBasicBlocks(function.handle, context);
481-
};
481+
}
482482
}
483483

484484
/// Fallback flag value calculation path. This method is invoked when the core is unable to
@@ -1544,14 +1544,14 @@ impl Architecture for CoreArchitecture {
15441544
}
15451545
}
15461546

1547-
fn analyze_basic_blocks(
1547+
unsafe fn analyze_basic_blocks(
15481548
&self,
15491549
function: &mut Function,
15501550
context: *mut BNBasicBlockAnalysisContext,
15511551
) {
15521552
unsafe {
15531553
BNArchitectureAnalyzeBasicBlocks(self.handle, function.handle, context);
1554-
};
1554+
}
15551555
}
15561556

15571557
fn flag_write_llil<'a>(
@@ -2267,7 +2267,9 @@ where
22672267
{
22682268
let custom_arch = unsafe { &*(ctxt as *mut A) };
22692269
let mut function = unsafe { Function::from_raw(function) };
2270-
custom_arch.analyze_basic_blocks(&mut function, context);
2270+
unsafe {
2271+
custom_arch.analyze_basic_blocks(&mut function, context);
2272+
}
22712273
}
22722274

22732275
extern "C" fn cb_reg_name<A>(ctxt: *mut c_void, reg: u32) -> *mut c_char

0 commit comments

Comments
 (0)