From 68b00cdf45551ba64c4f7217963055fc5a1a0cc4 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 30 May 2025 16:39:32 -0400 Subject: [Rust] Express expression vs instruction index for MLIL and HLIL APIs This was done to fix unintended behavior using an instruction or expression index in place of the other. Fixes https://github.com/Vector35/binaryninja-api/issues/6897 --- rust/src/language_representation.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rust/src/language_representation.rs') diff --git a/rust/src/language_representation.rs b/rust/src/language_representation.rs index 536203fe..6008ec0c 100644 --- a/rust/src/language_representation.rs +++ b/rust/src/language_representation.rs @@ -10,7 +10,7 @@ use crate::binary_view::BinaryView; use crate::disassembly::{DisassemblySettings, DisassemblyTextLine}; use crate::function::{Function, HighlightColor}; use crate::high_level_il::token_emitter::HighLevelILTokenEmitter; -use crate::high_level_il::{HighLevelILFunction, HighLevelInstructionIndex}; +use crate::high_level_il::{HighLevelExpressionIndex, HighLevelILFunction}; use crate::line_formatter::CoreLineFormatter; use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Ref, RefCountable}; use crate::string::{BnString, IntoCStr}; @@ -57,7 +57,7 @@ pub trait LanguageRepresentationFunction: Send + Sync { fn expr_text( &self, il: &HighLevelILFunction, - expr_index: HighLevelInstructionIndex, + expr_index: HighLevelExpressionIndex, tokens: &HighLevelILTokenEmitter, settings: &DisassemblySettings, as_full_ast: bool, @@ -68,14 +68,14 @@ pub trait LanguageRepresentationFunction: Send + Sync { fn begin_lines( &self, il: &HighLevelILFunction, - expr_index: HighLevelInstructionIndex, + expr_index: HighLevelExpressionIndex, tokens: &HighLevelILTokenEmitter, ); fn end_lines( &self, il: &HighLevelILFunction, - expr_index: HighLevelInstructionIndex, + expr_index: HighLevelExpressionIndex, tokens: &HighLevelILTokenEmitter, ); @@ -281,7 +281,7 @@ impl CoreLanguageRepresentationFunction { pub fn expr_text( &self, il: &HighLevelILFunction, - expr_index: HighLevelInstructionIndex, + expr_index: HighLevelExpressionIndex, settings: &DisassemblySettings, as_full_ast: bool, precedence: OperatorPrecedence, @@ -306,7 +306,7 @@ impl CoreLanguageRepresentationFunction { pub fn linear_lines( &self, il: &HighLevelILFunction, - expr_index: HighLevelInstructionIndex, + expr_index: HighLevelExpressionIndex, settings: &DisassemblySettings, as_full_ast: bool, ) -> Array { -- cgit v1.3.1