summaryrefslogtreecommitdiff
path: root/rust/src/architecture.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-09 14:01:25 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commitd50c2301d2b858713d924c072564994c12ad383b (patch)
treec01b5e475143d8f7a63acda260a6d10c7ff24ada /rust/src/architecture.rs
parent2a9beeec15d3f32312a0c4f8ad5ddbcfcbc97a89 (diff)
[Rust] Remove unneeded mut from Architecture trait signatures
These are never expressed, just adds another unneeded constraint on the impl
Diffstat (limited to 'rust/src/architecture.rs')
-rw-r--r--rust/src/architecture.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs
index a48cbce3..5ec63eef 100644
--- a/rust/src/architecture.rs
+++ b/rust/src/architecture.rs
@@ -467,7 +467,7 @@ pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
&self,
data: &[u8],
addr: u64,
- il: &mut MutableLiftedILFunction,
+ il: &MutableLiftedILFunction,
) -> Option<(usize, bool)>;
/// Fallback flag value calculation path. This method is invoked when the core is unable to
@@ -484,7 +484,7 @@ pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
flag: Self::Flag,
flag_write_type: Self::FlagWrite,
op: LowLevelILFlagWriteOp<Self::Register>,
- il: &'a mut MutableLiftedILFunction,
+ il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
let role = flag.role(flag_write_type.class());
Some(get_default_flag_write_llil(self, role, op, il))
@@ -513,7 +513,7 @@ pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
&self,
cond: FlagCondition,
class: Option<Self::FlagClass>,
- il: &'a mut MutableLiftedILFunction,
+ il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
Some(get_default_flag_cond_llil(self, cond, class, il))
}
@@ -535,7 +535,7 @@ pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
fn flag_group_llil<'a>(
&self,
_group: Self::FlagGroup,
- _il: &'a mut MutableLiftedILFunction,
+ _il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
None
}
@@ -1512,7 +1512,7 @@ impl Architecture for CoreArchitecture {
&self,
data: &[u8],
addr: u64,
- il: &mut MutableLiftedILFunction,
+ il: &MutableLiftedILFunction,
) -> Option<(usize, bool)> {
let mut size = data.len();
let success = unsafe {
@@ -1537,7 +1537,7 @@ impl Architecture for CoreArchitecture {
_flag: Self::Flag,
_flag_write: Self::FlagWrite,
_op: LowLevelILFlagWriteOp<Self::Register>,
- _il: &'a mut MutableLiftedILFunction,
+ _il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
None
}
@@ -1574,7 +1574,7 @@ impl Architecture for CoreArchitecture {
&self,
_cond: FlagCondition,
_class: Option<Self::FlagClass>,
- _il: &'a mut MutableLiftedILFunction,
+ _il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
None
}
@@ -1582,7 +1582,7 @@ impl Architecture for CoreArchitecture {
fn flag_group_llil<'a>(
&self,
_group: Self::FlagGroup,
- _il: &'a mut MutableLiftedILFunction,
+ _il: &'a MutableLiftedILFunction,
) -> Option<MutableLiftedILExpr<'a, ValueExpr>> {
None
}
@@ -2223,10 +2223,10 @@ where
{
let custom_arch = unsafe { &*(ctxt as *mut A) };
let data = unsafe { std::slice::from_raw_parts(data, *len) };
- let mut lifter =
+ let lifter =
unsafe { MutableLiftedILFunction::from_raw_with_arch(il, Some(*custom_arch.as_ref())) };
- match custom_arch.instruction_llil(data, addr, &mut lifter) {
+ match custom_arch.instruction_llil(data, addr, &lifter) {
Some((res_len, res_value)) => {
unsafe { *len = res_len };
res_value
@@ -2610,12 +2610,12 @@ where
let flag_write = custom_arch.flag_write_from_id(FlagWriteId(flag_write));
let flag = custom_arch.flag_from_id(FlagId(flag));
let operands = unsafe { std::slice::from_raw_parts(operands_raw, operand_count) };
- let mut lifter =
+ let lifter =
unsafe { MutableLiftedILFunction::from_raw_with_arch(il, Some(*custom_arch.as_ref())) };
if let (Some(flag_write), Some(flag)) = (flag_write, flag) {
if let Some(op) = LowLevelILFlagWriteOp::from_op(custom_arch, size, op, operands) {
- if let Some(expr) = custom_arch.flag_write_llil(flag, flag_write, op, &mut lifter) {
+ if let Some(expr) = custom_arch.flag_write_llil(flag, flag_write, op, &lifter) {
// TODO verify that returned expr is a bool value
return expr.index.0;
}
@@ -2659,9 +2659,9 @@ where
let custom_arch = unsafe { &*(ctxt as *mut A) };
let class = custom_arch.flag_class_from_id(FlagClassId(class));
- let mut lifter =
+ let lifter =
unsafe { MutableLiftedILFunction::from_raw_with_arch(il, Some(*custom_arch.as_ref())) };
- if let Some(expr) = custom_arch.flag_cond_llil(cond, class, &mut lifter) {
+ if let Some(expr) = custom_arch.flag_cond_llil(cond, class, &lifter) {
// TODO verify that returned expr is a bool value
return expr.index.0;
}
@@ -2678,11 +2678,11 @@ where
A: 'static + Architecture<Handle = CustomArchitectureHandle<A>> + Send + Sync,
{
let custom_arch = unsafe { &*(ctxt as *mut A) };
- let mut lifter =
+ let lifter =
unsafe { MutableLiftedILFunction::from_raw_with_arch(il, Some(*custom_arch.as_ref())) };
if let Some(group) = custom_arch.flag_group_from_id(FlagGroupId(group)) {
- if let Some(expr) = custom_arch.flag_group_llil(group, &mut lifter) {
+ if let Some(expr) = custom_arch.flag_group_llil(group, &lifter) {
// TODO verify that returned expr is a bool value
return expr.index.0;
}