Skip to content

Commit 82f6cd8

Browse files
committed
[Rust] Fix off-by-one accesses to operand lists within MediumLevelILInstruction::lift
This could result in a crash or incorrect data being read. Fixes #8155
1 parent b05c5f8 commit 82f6cd8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rust/src/medium_level_il/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl MediumLevelILInstruction {
851851
MemPhi(op) => Lifted::MemPhi(LiftedMemPhi {
852852
dest_memory: op.dest_memory,
853853
// TODO: Make a stronger type for this.
854-
src_memory: self.get_operand_list(0),
854+
src_memory: self.get_operand_list(1),
855855
}),
856856
VarSplit(op) => Lifted::VarSplit(op),
857857
SetVarSplit(op) => Lifted::SetVarSplit(LiftedSetVarSplit {
@@ -977,7 +977,7 @@ impl MediumLevelILInstruction {
977977
)
978978
.expect("Valid intrinsic"),
979979
params: self
980-
.get_expr_list(3)
980+
.get_expr_list(2)
981981
.iter()
982982
.map(|expr| expr.lift())
983983
.collect(),

0 commit comments

Comments
 (0)