Skip to content

Commit 392ab6d

Browse files
committed
refactor and fix OperandStack::operand_to_temp_at method
1 parent 12a9c5a commit 392ab6d

File tree

1 file changed

+2
-6
lines changed
  • crates/wasmi/src/engine/translator/func2/stack

1 file changed

+2
-6
lines changed

crates/wasmi/src/engine/translator/func2/stack/operands.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,9 @@ impl OperandStack {
270270
#[must_use]
271271
fn operand_to_temp_at(&mut self, index: OperandIdx) -> StackOperand {
272272
let operand = self.get_at(index);
273-
match operand {
274-
StackOperand::Temp { ty, .. } => ty,
275-
StackOperand::Immediate { val } => val.ty(),
276-
StackOperand::Local { local_index, .. } => self.locals.ty(local_index),
277-
};
273+
let ty = operand.ty(&self.locals);
278274
self.unlink_local(operand);
279-
self.operands[usize::from(index)] = operand;
275+
self.operands[usize::from(index)] = StackOperand::Temp { ty, instr: None };
280276
operand
281277
}
282278

0 commit comments

Comments
 (0)