Skip to content

Commit b1c2bb1

Browse files
committed
[Rust] Add Function::variable_type
1 parent f9ac749 commit b1c2bb1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rust/src/function.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,15 @@ impl Function {
467467
}
468468
}
469469

470+
pub fn variable_type(&self, var: &Variable) -> Option<Conf<Ref<Type>>> {
471+
let raw_var = BNVariable::from(var);
472+
let result = unsafe { BNGetVariableType(self.handle, &raw_var) };
473+
match result.type_.is_null() {
474+
false => Some(Conf::<Ref<Type>>::from_owned_raw(result)),
475+
true => None,
476+
}
477+
}
478+
470479
pub fn high_level_il(&self, full_ast: bool) -> Result<Ref<HighLevelILFunction>, ()> {
471480
unsafe {
472481
let hlil_ptr = BNGetFunctionHighLevelIL(self.handle);

0 commit comments

Comments
 (0)