Skip to content

Commit 02503e2

Browse files
committed
[Rust] Remove duplicate BNGetMediumLevelILVariableDefinitions wrapper function
1 parent a7c6eca commit 02503e2

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

rust/src/medium_level_il/function.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ impl MediumLevelILFunction {
117117
unsafe { Array::new(blocks, count, context) }
118118
}
119119

120-
pub fn var_definitions(&self, var: &Variable) -> Array<MediumLevelILInstruction> {
121-
let mut count = 0;
122-
let raw_var = BNVariable::from(var);
123-
let raw_instr_idxs =
124-
unsafe { BNGetMediumLevelILVariableDefinitions(self.handle, &raw_var, &mut count) };
125-
assert!(!raw_instr_idxs.is_null());
126-
unsafe { Array::new(raw_instr_idxs, count, self.to_owned()) }
127-
}
128-
129120
pub fn create_user_stack_var<'a, C: Into<Conf<&'a Type>>>(
130121
self,
131122
offset: i64,
@@ -229,7 +220,7 @@ impl MediumLevelILFunction {
229220
/// * `def_addr` - Address of the definition site of the variable
230221
pub fn clear_user_var_value(&self, var: &Variable, addr: u64, after: bool) -> Result<(), ()> {
231222
let Some(_var_def) = self
232-
.var_definitions(var)
223+
.variable_definitions(var)
233224
.iter()
234225
.find(|site| site.address == addr)
235226
else {
@@ -507,6 +498,7 @@ impl MediumLevelILFunction {
507498
let raw_var = BNVariable::from(variable);
508499
let defs =
509500
unsafe { BNGetMediumLevelILVariableDefinitions(self.handle, &raw_var, &mut count) };
501+
assert!(!defs.is_null());
510502
unsafe { Array::new(defs, count, self.to_owned()) }
511503
}
512504

0 commit comments

Comments
 (0)