diff options
Diffstat (limited to 'crates/parser')
| -rw-r--r-- | crates/parser/src/conversion.rs | 2 | ||||
| -rw-r--r-- | crates/parser/src/visit.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index 8a12daa..fea43ba 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -271,7 +271,7 @@ pub(crate) fn process_const_operators(ops: OperatorsReader<'_>) -> Result<Box<[C wasmparser::Operator::I64Const { value } => ConstInstruction::I64Const(*value), wasmparser::Operator::F32Const { value } => ConstInstruction::F32Const(f32::from_bits(value.bits())), wasmparser::Operator::F64Const { value } => ConstInstruction::F64Const(f64::from_bits(value.bits())), - wasmparser::Operator::V128Const { value } => ConstInstruction::V128Const(value.i128()), + wasmparser::Operator::V128Const { value } => ConstInstruction::V128Const(*value.bytes()), wasmparser::Operator::GlobalGet { global_index } => ConstInstruction::GlobalGet(*global_index), wasmparser::Operator::I32Add => ConstInstruction::I32Add, wasmparser::Operator::I32Sub => ConstInstruction::I32Sub, diff --git a/crates/parser/src/visit.rs b/crates/parser/src/visit.rs index 62db307..d1612ed 100644 --- a/crates/parser/src/visit.rs +++ b/crates/parser/src/visit.rs @@ -400,11 +400,11 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild } fn visit_f32_const(&mut self, val: wasmparser::Ieee32) -> Self::Output { - self.instructions.push(Instruction::Const32(i32::from_ne_bytes(val.bits().to_ne_bytes()))); + self.instructions.push(Instruction::Const32(val.bits() as i32)); } fn visit_f64_const(&mut self, val: wasmparser::Ieee64) -> Self::Output { - self.instructions.push(Instruction::Const64(i64::from_ne_bytes(val.bits().to_ne_bytes()))); + self.instructions.push(Instruction::Const64(val.bits() as i64)); } fn visit_table_copy(&mut self, dst_table: u32, src_table: u32) -> Self::Output { |
