Skip to content

Commit 29a1fb2

Browse files
committed
[Rust] Fix untyped expr_idx within MLIL ILReferenceSource
1 parent bd37400 commit 29a1fb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/src/medium_level_il/function.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl MediumLevelILFunction {
220220
/// # use binaryninja::variable::Variable;
221221
/// # let mlil_fun: MediumLevelILFunction = todo!();
222222
/// # let mlil_var: Variable = todo!();
223-
/// let instr_idx = mlil_fun.var_refs(&mlil_var).get(0).expr_idx;
223+
/// let instr_addr = mlil_fun.var_refs(&mlil_var).get(0).addr;
224224
/// ```
225225
pub fn var_refs(&self, var: &Variable) -> Array<ILReferenceSource> {
226226
let mut count = 0;
@@ -525,7 +525,7 @@ pub struct ILReferenceSource {
525525
pub arch: CoreArchitecture,
526526
pub addr: u64,
527527
pub graph_type: FunctionGraphType,
528-
pub expr_idx: usize,
528+
pub expr_idx: MediumLevelExpressionIndex,
529529
}
530530

531531
impl From<BNILReferenceSource> for ILReferenceSource {
@@ -535,7 +535,7 @@ impl From<BNILReferenceSource> for ILReferenceSource {
535535
arch: unsafe { CoreArchitecture::from_raw(value.arch) },
536536
addr: value.addr,
537537
graph_type: value.type_,
538-
expr_idx: value.exprId,
538+
expr_idx: MediumLevelExpressionIndex(value.exprId),
539539
}
540540
}
541541
}
@@ -547,7 +547,7 @@ impl From<&BNILReferenceSource> for ILReferenceSource {
547547
arch: unsafe { CoreArchitecture::from_raw(value.arch) },
548548
addr: value.addr,
549549
graph_type: value.type_,
550-
expr_idx: value.exprId,
550+
expr_idx: MediumLevelExpressionIndex(value.exprId),
551551
}
552552
}
553553
}

0 commit comments

Comments
 (0)