diff options
Diffstat (limited to 'rust/src/medium_level_il/function.rs')
| -rw-r--r-- | rust/src/medium_level_il/function.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/rust/src/medium_level_il/function.rs b/rust/src/medium_level_il/function.rs index 0ac82ff1..de3ece02 100644 --- a/rust/src/medium_level_il/function.rs +++ b/rust/src/medium_level_il/function.rs @@ -11,7 +11,7 @@ use crate::disassembly::DisassemblySettings; use crate::flowgraph::FlowGraph; use crate::function::{Function, Location}; use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Ref, RefCountable}; -use crate::string::BnStrCompatible; +use crate::string::AsCStr; use crate::types::Type; use crate::variable::{PossibleValueSet, RegisterValue, SSAVariable, UserVariableValue, Variable}; @@ -122,14 +122,14 @@ impl MediumLevelILFunction { unsafe { Array::new(raw_instr_idxs, count, self.to_owned()) } } - pub fn create_user_stack_var<'a, S: BnStrCompatible, C: Into<Conf<&'a Type>>>( + pub fn create_user_stack_var<'a, S: AsCStr, C: Into<Conf<&'a Type>>>( self, offset: i64, var_type: C, name: S, ) { let mut owned_raw_var_ty = Conf::<&Type>::into_raw(var_type.into()); - let name = name.into_bytes_with_nul(); + let name = name.to_cstr(); unsafe { BNCreateUserStackVariable( self.function().handle, @@ -144,7 +144,7 @@ impl MediumLevelILFunction { unsafe { BNDeleteUserStackVariable(self.function().handle, offset) } } - pub fn create_user_var<'a, S: BnStrCompatible, C: Into<Conf<&'a Type>>>( + pub fn create_user_var<'a, S: AsCStr, C: Into<Conf<&'a Type>>>( &self, var: &Variable, var_type: C, @@ -153,7 +153,7 @@ impl MediumLevelILFunction { ) { let raw_var = BNVariable::from(var); let mut owned_raw_var_ty = Conf::<&Type>::into_raw(var_type.into()); - let name = name.into_bytes_with_nul(); + let name = name.to_cstr(); unsafe { BNCreateUserVariable( self.function().handle, @@ -274,14 +274,14 @@ impl MediumLevelILFunction { Ok(()) } - pub fn create_auto_stack_var<'a, T: Into<Conf<&'a Type>>, S: BnStrCompatible>( + pub fn create_auto_stack_var<'a, T: Into<Conf<&'a Type>>, S: AsCStr>( &self, offset: i64, var_type: T, name: S, ) { let mut owned_raw_var_ty = Conf::<&Type>::into_raw(var_type.into()); - let name = name.into_bytes_with_nul(); + let name = name.to_cstr(); let name_c_str = name.as_ref(); unsafe { BNCreateAutoStackVariable( @@ -297,7 +297,7 @@ impl MediumLevelILFunction { unsafe { BNDeleteAutoStackVariable(self.function().handle, offset) } } - pub fn create_auto_var<'a, S: BnStrCompatible, C: Into<Conf<&'a Type>>>( + pub fn create_auto_var<'a, S: AsCStr, C: Into<Conf<&'a Type>>>( &self, var: &Variable, var_type: C, @@ -306,7 +306,7 @@ impl MediumLevelILFunction { ) { let raw_var = BNVariable::from(var); let mut owned_raw_var_ty = Conf::<&Type>::into_raw(var_type.into()); - let name = name.into_bytes_with_nul(); + let name = name.to_cstr(); let name_c_str = name.as_ref(); unsafe { BNCreateAutoVariable( |
