summaryrefslogtreecommitdiff
path: root/rust/tests/high_level_il.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-30 16:39:32 -0400
committerMason Reed <mason@vector35.com>2025-05-30 19:17:10 -0400
commit68b00cdf45551ba64c4f7217963055fc5a1a0cc4 (patch)
treef6bdef06bc02d16596bdf62870c8a1cfafe49859 /rust/tests/high_level_il.rs
parent77ab5e812af200b8e3bca0aac31d5fe0f638fba3 (diff)
[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
Diffstat (limited to 'rust/tests/high_level_il.rs')
-rw-r--r--rust/tests/high_level_il.rs7
1 files changed, 5 insertions, 2 deletions
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 {