summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rowe <mrowe@bdash.net.nz>2025-05-27 15:14:22 -0700
committerMason Reed <mason@vector35.com>2025-05-30 19:17:10 -0400
commit1e3b9e54fb7947d5b4b46ed01d1dd8a16e7537af (patch)
tree81d566f004c3d9f2879e7ee74f3dcf5fe073e3e7
parent6e8116614b43097800f0e7b493260c4aaadd7c29 (diff)
[Rust] Add support for LLIL_SEPARATE_PARAM_LIST_SSA
-rw-r--r--rust/src/low_level_il/expression.rs15
-rw-r--r--rust/src/low_level_il/operation.rs30
2 files changed, 45 insertions, 0 deletions
diff --git a/rust/src/low_level_il/expression.rs b/rust/src/low_level_il/expression.rs
index ce9d5bba..902d3b30 100644
--- a/rust/src/low_level_il/expression.rs
+++ b/rust/src/low_level_il/expression.rs
@@ -326,6 +326,8 @@ where
FcmpO(Operation<'func, M, F, operation::Condition>),
FcmpUO(Operation<'func, M, F, operation::Condition>),
+ SeparateParamListSsa(Operation<'func, M, F, operation::SeparateParamListSsa>),
+
// TODO ADD_OVERFLOW
Unimpl(Operation<'func, M, F, operation::NoArgs>),
UnimplMem(Operation<'func, M, F, operation::UnimplMem>),
@@ -474,6 +476,10 @@ where
LLIL_FCMP_O => LowLevelILExpressionKind::FcmpO(Operation::new(function, op, index)),
LLIL_FCMP_UO => LowLevelILExpressionKind::FcmpUO(Operation::new(function, op, index)),
+ LLIL_SEPARATE_PARAM_LIST_SSA => {
+ LowLevelILExpressionKind::SeparateParamListSsa(Operation::new(function, op, index))
+ }
+
LLIL_UNIMPL => LowLevelILExpressionKind::Unimpl(Operation::new(function, op, index)),
LLIL_UNIMPL_MEM => {
LowLevelILExpressionKind::UnimplMem(Operation::new(function, op, index))
@@ -644,6 +650,11 @@ where
visit!(param_expr);
}
}
+ SeparateParamListSsa(ref op) => {
+ for param_expr in op.param_exprs() {
+ visit!(param_expr);
+ }
+ }
// Do not have any sub expressions.
Pop(_) | Reg(_) | RegSsa(_) | RegPartialSsa(_) | RegSplit(_) | RegSplitSsa(_)
| Const(_) | ConstPtr(_) | Flag(_) | FlagBit(_) | ExternPtr(_) | FlagCond(_)
@@ -714,6 +725,8 @@ where
| FloatToInt(ref op) | IntToFloat(ref op) | FloatConv(ref op) | RoundToInt(ref op)
| Floor(ref op) | Ceil(ref op) | Ftrunc(ref op) => &op.op,
+ SeparateParamListSsa(ref op) => &op.op,
+
UnimplMem(ref op) => &op.op,
//TestBit(Operation<'func, M, F, operation::TestBit>), // TODO
}
@@ -784,6 +797,8 @@ impl LowLevelILExpressionKind<'_, Mutable, NonSSA> {
| FloatToInt(ref op) | IntToFloat(ref op) | FloatConv(ref op) | RoundToInt(ref op)
| Floor(ref op) | Ceil(ref op) | Ftrunc(ref op) => op.flag_write(),
+ SeparateParamListSsa(ref op) => op.flag_write(),
+
UnimplMem(ref op) => op.flag_write(),
//TestBit(Operation<'func, M, F, operation::TestBit>), // TODO
}
diff --git a/rust/src/low_level_il/operation.rs b/rust/src/low_level_il/operation.rs
index 382b4927..bc8e579e 100644
--- a/rust/src/low_level_il/operation.rs
+++ b/rust/src/low_level_il/operation.rs
@@ -2111,6 +2111,35 @@ where
}
}
+// LLIL_SEPARATE_PARAM_LIST_SSA
+pub struct SeparateParamListSsa;
+
+impl<'func, M, F> Operation<'func, M, F, SeparateParamListSsa>
+where
+ M: FunctionMutability,
+ F: FunctionForm,
+{
+ pub fn param_exprs(&self) -> Vec<LowLevelILExpression<'func, M, F, ValueExpr>> {
+ self.get_operand_list(0)
+ .into_iter()
+ .map(|val| LowLevelExpressionIndex(val as usize))
+ .map(|expr_idx| LowLevelILExpression::new(self.function, expr_idx))
+ .collect()
+ }
+}
+
+impl<M, F> Debug for Operation<'_, M, F, SeparateParamListSsa>
+where
+ M: FunctionMutability,
+ F: FunctionForm,
+{
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.debug_struct("SeparateParamListSsa")
+ .field("param_exprs", &self.param_exprs())
+ .finish()
+ }
+}
+
// TODO TEST_BIT
pub trait OperationArguments: 'static {}
@@ -2168,3 +2197,4 @@ impl OperationArguments for Assert {}
impl OperationArguments for AssertSsa {}
impl OperationArguments for ForceVersion {}
impl OperationArguments for ForceVersionSsa {}
+impl OperationArguments for SeparateParamListSsa {}