Skip to content

Commit

Permalink
Fix ARM64 Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
D0ntPanic committed May 20, 2024
1 parent 27bc08f commit 331d226
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rust/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub use binaryninjacore_sys::BNFunctionAnalysisSkipOverride as FunctionAnalysisS
pub use binaryninjacore_sys::BNFunctionUpdateType as FunctionUpdateType;

use std::{fmt, mem};
use std::{hash::Hash, ops::Range};
use std::{ffi::c_char, hash::Hash, ops::Range};

pub struct Location {
pub arch: Option<CoreArchitecture>,
Expand Down Expand Up @@ -1499,7 +1499,7 @@ impl Function {
let arch = arch.unwrap_or_else(|| self.arch());
let enum_display_typeid = enum_display_typeid.map(BnStrCompatible::into_bytes_with_nul);
let enum_display_typeid_ptr = enum_display_typeid
.map(|x| x.as_ref().as_ptr() as *const i8)
.map(|x| x.as_ref().as_ptr() as *const c_char)
.unwrap_or(core::ptr::null());
unsafe {
BNSetIntegerConstantDisplayType(
Expand Down Expand Up @@ -1944,7 +1944,7 @@ impl Function {
.iter()
.position(|(alias, _value)| *alias == name)
{
let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const i8;
let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const c_char;
unsafe { BNRequestFunctionDebugReport(self.handle, name) }
} else {
let name = std::ffi::CString::new(name.to_string()).unwrap();
Expand Down
7 changes: 4 additions & 3 deletions rust/src/mlil/function.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use core::hash::{Hash, Hasher};
use std::ffi::c_char;

use binaryninjacore_sys::*;

Expand Down Expand Up @@ -127,7 +128,7 @@ impl MediumLevelILFunction {
self.get_function().handle,
offset,
&mut raw_var_type,
name.as_ref().as_ptr() as *const i8,
name.as_ref().as_ptr() as *const c_char,
)
}
}
Expand Down Expand Up @@ -270,7 +271,7 @@ impl MediumLevelILFunction {
self.get_function().handle,
offset,
&mut var_type,
name_c_str.as_ptr() as *const i8,
name_c_str.as_ptr() as *const c_char,
)
}
}
Expand All @@ -295,7 +296,7 @@ impl MediumLevelILFunction {
self.get_function().handle,
&var.raw(),
&mut var_type,
name_c_str.as_ptr() as *const i8,
name_c_str.as_ptr() as *const c_char,
ignore_disjoint_uses,
)
}
Expand Down

0 comments on commit 331d226

Please sign in to comment.