From 08e34ac325743085911f96b62c81d9a1f2127806 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 27 Apr 2026 16:39:21 -0400 Subject: Extend MLIL call instruction outputs to be expressions --- rust/src/medium_level_il/operation.rs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'rust/src/medium_level_il/operation.rs') diff --git a/rust/src/medium_level_il/operation.rs b/rust/src/medium_level_il/operation.rs index 578087d0..a9a791b0 100644 --- a/rust/src/medium_level_il/operation.rs +++ b/rust/src/medium_level_il/operation.rs @@ -325,7 +325,7 @@ pub struct Call { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedCall { - pub output: Vec, + pub output: Vec, pub dest: Box, pub params: Vec, } @@ -388,7 +388,7 @@ pub struct Syscall { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedSyscallCall { - pub output: Vec, + pub output: Vec, pub params: Vec, } @@ -465,7 +465,7 @@ pub struct CallSsa { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedCallSsa { - pub output: Vec, + pub output: Vec, pub dest: Box, pub params: Vec, pub src_memory: u64, @@ -481,7 +481,7 @@ pub struct CallUntypedSsa { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedCallUntypedSsa { - pub output: Vec, + pub output: Vec, pub dest: Box, pub params: Vec, pub stack: Box, @@ -497,7 +497,7 @@ pub struct SyscallSsa { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedSyscallSsa { - pub output: Vec, + pub output: Vec, pub params: Vec, pub src_memory: u64, } @@ -511,7 +511,7 @@ pub struct SyscallUntypedSsa { } #[derive(Clone, Debug, PartialEq)] pub struct LiftedSyscallUntypedSsa { - pub output: Vec, + pub output: Vec, pub params: Vec, pub stack: Box, } @@ -519,14 +519,15 @@ pub struct LiftedSyscallUntypedSsa { // CALL_UNTYPED, TAILCALL_UNTYPED #[derive(Debug, Copy, Clone)] pub struct CallUntyped { - pub output: MediumLevelExpressionIndex, + pub first_output: usize, + pub num_outputs: usize, pub dest: MediumLevelExpressionIndex, pub params: MediumLevelExpressionIndex, pub stack: MediumLevelExpressionIndex, } #[derive(Clone, Debug, PartialEq)] pub struct LiftedCallUntyped { - pub output: Vec, + pub output: Vec, pub dest: Box, pub params: Vec, pub stack: Box, @@ -535,13 +536,14 @@ pub struct LiftedCallUntyped { // SYSCALL_UNTYPED #[derive(Debug, Copy, Clone)] pub struct SyscallUntyped { - pub output: MediumLevelExpressionIndex, + pub first_output: usize, + pub num_outputs: usize, pub params: MediumLevelExpressionIndex, pub stack: MediumLevelExpressionIndex, } #[derive(Clone, Debug, PartialEq)] pub struct LiftedSyscallUntyped { - pub output: Vec, + pub output: Vec, pub params: Vec, pub stack: Box, } @@ -633,6 +635,12 @@ pub struct Var { pub src: Variable, } +// VAR_OUTPUT +#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] +pub struct VarOutput { + pub dest: Variable, +} + // VAR_FIELD, ADDRESS_OF_FIELD #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] pub struct Field { @@ -653,6 +661,12 @@ pub struct VarSsaField { pub offset: u64, } +// VAR_OUTPUT_SSA +#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] +pub struct VarOutputSsa { + pub dest: SSAVariable, +} + // TRAP #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] pub struct Trap { -- cgit v1.3.1