From 80b07dfa158bb093cc93e602363655b62ae595f8 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 22 Dec 2023 13:46:10 -0700 Subject: Support function recognizers in Rust architecture plugins --- rust/src/llil/instruction.rs | 4 +++- rust/src/llil/mod.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'rust/src/llil') diff --git a/rust/src/llil/instruction.rs b/rust/src/llil/instruction.rs index c9817dbf..36733472 100644 --- a/rust/src/llil/instruction.rs +++ b/rust/src/llil/instruction.rs @@ -111,6 +111,7 @@ where LLIL_CALL | LLIL_CALL_STACK_ADJUST => { InstrInfo::Call(Operation::new(self.function, op)) } + LLIL_TAILCALL => InstrInfo::TailCall(Operation::new(self.function, op)), LLIL_SYSCALL => InstrInfo::Syscall(Operation::new(self.function, op)), LLIL_INTRINSIC => InstrInfo::Intrinsic(Operation::new(self.function, op)), _ => { @@ -149,7 +150,7 @@ where visit!(fb, &op.source_expr()); } Push(ref op) => visit!(fb, &op.operand()), - Call(ref op) => visit!(fb, &op.target()), + Call(ref op) | TailCall(ref op) => visit!(fb, &op.target()), Intrinsic(ref _op) => { // TODO: Use this when we support expression lists // for expr in op.source_exprs() { @@ -180,6 +181,7 @@ where JumpTo(Operation<'func, A, M, F, operation::JumpTo>), Call(Operation<'func, A, M, F, operation::Call>), + TailCall(Operation<'func, A, M, F, operation::Call>), Ret(Operation<'func, A, M, F, operation::Ret>), NoRet(Operation<'func, A, M, F, operation::NoArgs>), diff --git a/rust/src/llil/mod.rs b/rust/src/llil/mod.rs index f7696d57..8d199a2a 100644 --- a/rust/src/llil/mod.rs +++ b/rust/src/llil/mod.rs @@ -49,7 +49,7 @@ pub type LiftedExpr<'a, Arch> = Expression<'a, Arch, Mutable, NonSSA = Function>; pub type SSAFunction = Function; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] pub enum Register { ArchReg(R), Temp(u32), -- cgit v1.3.1