summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2024-04-26 18:24:46 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2024-04-30 13:12:21 -0400
commit2cd83c7221f8587975bcfc7582eb5b8c73f1653e (patch)
tree0fe6b90981488059bbdeff552f9cd9b8566b617c /rust/src
parent7c04b4b1f27d1d388bfc6bb793f076d38366b849 (diff)
Allow fetching target instruction index in LLIL branches from the Rust API
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/llil/operation.rs20
1 files changed, 16 insertions, 4 deletions
diff --git a/rust/src/llil/operation.rs b/rust/src/llil/operation.rs
index 3c40f207..3ba4fa78 100644
--- a/rust/src/llil/operation.rs
+++ b/rust/src/llil/operation.rs
@@ -89,10 +89,10 @@ pub struct Syscall;
pub struct Intrinsic;
impl<'func, A, M, V> Operation<'func, A, M, NonSSA<V>, Intrinsic>
- where
- A: 'func + Architecture,
- M: FunctionMutability,
- V: NonSSAVariant,
+where
+ A: 'func + Architecture,
+ M: FunctionMutability,
+ V: NonSSAVariant,
{
// TODO: Support register and expression lists
pub fn intrinsic(&self) -> Option<A::Intrinsic> {
@@ -382,12 +382,20 @@ where
}
}
+ pub fn true_target_idx(&self) -> usize {
+ self.op.operands[1] as usize
+ }
+
pub fn false_target(&self) -> Instruction<'func, A, M, F> {
Instruction {
function: self.function,
instr_idx: self.op.operands[2] as usize,
}
}
+
+ pub fn false_target_idx(&self) -> usize {
+ self.op.operands[2] as usize
+ }
}
// LLIL_GOTO
@@ -405,6 +413,10 @@ where
instr_idx: self.op.operands[0] as usize,
}
}
+
+ pub fn target_idx(&self) -> usize {
+ self.op.operands[0] as usize
+ }
}
// LLIL_FLAG_COND