diff options
Diffstat (limited to 'rust/src/medium_level_il')
| -rw-r--r-- | rust/src/medium_level_il/function.rs | 14 | ||||
| -rw-r--r-- | rust/src/medium_level_il/instruction.rs | 16 |
2 files changed, 11 insertions, 19 deletions
diff --git a/rust/src/medium_level_il/function.rs b/rust/src/medium_level_il/function.rs index 8751111b..4206f7dd 100644 --- a/rust/src/medium_level_il/function.rs +++ b/rust/src/medium_level_il/function.rs @@ -183,7 +183,7 @@ impl MediumLevelILFunction { /// Allows the user to specify a PossibleValueSet value for an MLIL /// variable at its definition site. /// - /// .. warning:: Setting the variable value, triggers a reanalysis of the + /// WARNING: Setting the variable value, triggers a reanalysis of the /// function and allows the dataflow to compute and propagate values which /// depend on the current variable. This implies that branch conditions /// whose values can be determined statically will be computed, leading to @@ -212,23 +212,15 @@ impl MediumLevelILFunction { value: PossibleValueSet, after: bool, ) -> Result<(), ()> { - let Some(_def_site) = self - .var_definitions(var) - .iter() - .find(|def| def.address == addr) - else { - // Error "No definition for Variable found at given address" - return Err(()); - }; let function = self.function(); let def_site = BNArchitectureAndAddress { arch: function.arch().handle, address: addr, }; let raw_var = BNVariable::from(var); - let raw_value = PossibleValueSet::into_raw(value); + let raw_value = PossibleValueSet::into_rust_raw(value); unsafe { BNSetUserVariableValue(function.handle, &raw_var, &def_site, after, &raw_value) } - PossibleValueSet::free_owned_raw(raw_value); + PossibleValueSet::free_rust_raw(raw_value); Ok(()) } diff --git a/rust/src/medium_level_il/instruction.rs b/rust/src/medium_level_il/instruction.rs index 3af9e424..ebe99275 100644 --- a/rust/src/medium_level_il/instruction.rs +++ b/rust/src/medium_level_il/instruction.rs @@ -1167,7 +1167,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn possible_ssa_variable_values(&self, ssa_var: &SSAVariable) -> PossibleValueSet { @@ -1190,7 +1190,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } /// Return the ssa version of a [`Variable`] at the given instruction. @@ -1390,7 +1390,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn possible_register_values_after(&self, reg_id: RegisterId) -> PossibleValueSet { @@ -1411,7 +1411,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn flag_value(&self, flag_id: FlagId) -> RegisterValue { @@ -1454,7 +1454,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn possible_flag_values_after_with_opts( @@ -1471,7 +1471,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn stack_contents(&self, offset: i64, size: usize) -> RegisterValue { @@ -1514,7 +1514,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } pub fn possible_stack_contents_after_with_opts( @@ -1533,7 +1533,7 @@ impl MediumLevelILInstruction { options.len(), ) }; - PossibleValueSet::from_owned_raw(value) + PossibleValueSet::from_owned_core_raw(value) } /// Gets the unique variable for a definition instruction. This unique variable can be passed |
