Skip to content

Commit b5cba8f

Browse files
committed
fix translate_reinterpret types
1 parent a55ef19 commit b5cba8f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • crates/wasmi/src/engine/translator/func2

crates/wasmi/src/engine/translator/func2/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,18 +1011,18 @@ impl FuncTranslator {
10111011
/// This Wasm operation is a no-op. Ideally we only have to change the types on the stack.
10121012
fn translate_reinterpret<T, R>(&mut self, consteval: fn(T) -> R) -> Result<(), Error>
10131013
where
1014-
T: From<TypedVal>,
1015-
R: Into<TypedVal>,
1014+
T: From<TypedVal> + Typed,
1015+
R: Into<TypedVal> + Typed,
10161016
{
10171017
bail_unreachable!(self);
10181018
match self.stack.pop() {
10191019
Operand::Local(input) => {
1020-
debug_assert!(matches!(input.ty(), ValType::I32));
1020+
debug_assert_eq!(input.ty(), <T as Typed>::TY);
10211021
todo!() // do we need a copy or should we allow to manipulate a local's type?
10221022
}
10231023
Operand::Temp(input) => {
1024-
debug_assert!(matches!(input.ty(), ValType::I32));
1025-
self.stack.push_temp(ValType::I64, None)?;
1024+
debug_assert_eq!(input.ty(), <T as Typed>::TY);
1025+
self.stack.push_temp(<R as Typed>::TY, None)?;
10261026
}
10271027
Operand::Immediate(input) => {
10281028
let input: T = input.val().into();

0 commit comments

Comments
 (0)