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/tests/high_level_il.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rust/tests/high_level_il.rs') diff --git a/rust/tests/high_level_il.rs b/rust/tests/high_level_il.rs index 4466678c..e757301e 100644 --- a/rust/tests/high_level_il.rs +++ b/rust/tests/high_level_il.rs @@ -1,6 +1,8 @@ use binaryninja::binary_view::BinaryViewExt; use binaryninja::headless::Session; -use binaryninja::high_level_il::{HighLevelILInstructionKind, HighLevelInstructionIndex}; +use binaryninja::high_level_il::{ + HighLevelExpressionIndex, HighLevelILInstructionKind, HighLevelInstructionIndex, +}; use std::path::PathBuf; #[test] @@ -23,7 +25,8 @@ fn test_hlil_info() { // 00025f22 HLIL_CALL (HLIL_CONST_PTR.d __crt_interlocked_read_32)((HLIL_VAR.d arg1)))) // 00025f10 ) let instr_0 = hlil_instr_iter.next().unwrap(); - assert_eq!(instr_0.expr_index, HighLevelInstructionIndex(5)); + assert_eq!(instr_0.instr_index, HighLevelInstructionIndex(0)); + assert_eq!(instr_0.expr_index, HighLevelExpressionIndex(5)); assert_eq!(instr_0.address, image_base + 0x00025f22); println!("{:?}", instr_0.kind); match instr_0.kind { -- cgit v1.3.1