diff options
| author | Michael Krasnitski <michael.krasnitski@gmail.com> | 2024-07-22 09:36:19 -0400 |
|---|---|---|
| committer | mason <35282038+emesare@users.noreply.github.com> | 2024-07-26 11:53:12 +0000 |
| commit | 8a5cd4b42efd254672d9e3e60e13702de7149ad4 (patch) | |
| tree | 81aa403f5e15e7b10baa9e06898b3341143afffa /rust/src | |
| parent | 85c04eac52abe3aa0c54cd079bf87e64a60b62bd (diff) | |
Add `VariableSourceType` type alias
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/types.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index d5be0e86..1c8071e8 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -55,6 +55,7 @@ pub type MemberAccess = BNMemberAccess; pub type MemberScope = BNMemberScope; pub type ILBranchDependence = BNILBranchDependence; pub type DataFlowQueryOption = BNDataFlowQueryOption; +pub type VariableSourceType = BNVariableSourceType; //////////////// // Confidence @@ -1378,9 +1379,9 @@ impl FunctionParameter { pub(crate) fn from_raw(member: BNFunctionParameter) -> Self { let name = if member.name.is_null() { - if member.location.type_ == BNVariableSourceType::RegisterVariableSourceType { + if member.location.type_ == VariableSourceType::RegisterVariableSourceType { format!("reg_{}", member.location.storage) - } else if member.location.type_ == BNVariableSourceType::StackVariableSourceType { + } else if member.location.type_ == VariableSourceType::StackVariableSourceType { format!("arg_{}", member.location.storage) } else { String::new() @@ -1412,13 +1413,13 @@ impl FunctionParameter { #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] pub struct Variable { - pub t: BNVariableSourceType, + pub t: VariableSourceType, pub index: u32, pub storage: i64, } impl Variable { - pub fn new(t: BNVariableSourceType, index: u32, storage: i64) -> Self { + pub fn new(t: VariableSourceType, index: u32, storage: i64) -> Self { Self { t, index, storage } } |
