Use floats for wasmtime::component::Val::Float* (#5510)
The definitions of `wasmtime::component::Val::Float{32,64}` mirrored
`wasmtime::Val::F{32,64}` by using integers as their wrapped types,
storing the bit representation of their floating point values.
This was necessary for the core Wasm `f32`/`f64` types because Rust
floats don't have guaranteed NaN bit representations.
The component model `float32`/`float64` types require NaN
canonicalization, so we can use normal Rust `f{32,64}` instead.
Closes #5480
This commit is contained in:
@@ -34,8 +34,8 @@ pub fn arbitrary_val(ty: &component::Type, input: &mut Unstructured) -> arbitrar
|
||||
Type::U32 => Val::U32(input.arbitrary()?),
|
||||
Type::S64 => Val::S64(input.arbitrary()?),
|
||||
Type::U64 => Val::U64(input.arbitrary()?),
|
||||
Type::Float32 => Val::Float32(input.arbitrary::<f32>()?.to_bits()),
|
||||
Type::Float64 => Val::Float64(input.arbitrary::<f64>()?.to_bits()),
|
||||
Type::Float32 => Val::Float32(input.arbitrary()?),
|
||||
Type::Float64 => Val::Float64(input.arbitrary()?),
|
||||
Type::Char => Val::Char(input.arbitrary()?),
|
||||
Type::String => Val::String(input.arbitrary()?),
|
||||
Type::List(list) => {
|
||||
|
||||
Reference in New Issue
Block a user