mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibWasm: Fix some floating-point conversion issues
NaN bit patterns are now (hopefully) preserved. `static_cast` does not preserve the bit pattern of a given NaN, so ideally we'd use some other sort of cast and avoid `static_cast` altogether, but that's a large change for this commit. For now, this fixes the issues found in spec tests.
This commit is contained in:
@@ -519,10 +519,10 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi
|
||||
configuration.stack().push(Value(ValueType { ValueType::I64 }, instruction.arguments().get<i64>()));
|
||||
return;
|
||||
case Instructions::f32_const.value():
|
||||
configuration.stack().push(Value(ValueType { ValueType::F32 }, static_cast<double>(instruction.arguments().get<float>())));
|
||||
configuration.stack().push(Value(Value::AnyValueType(instruction.arguments().get<float>())));
|
||||
return;
|
||||
case Instructions::f64_const.value():
|
||||
configuration.stack().push(Value(ValueType { ValueType::F64 }, instruction.arguments().get<double>()));
|
||||
configuration.stack().push(Value(Value::AnyValueType(instruction.arguments().get<double>())));
|
||||
return;
|
||||
case Instructions::block.value(): {
|
||||
size_t arity = 0;
|
||||
|
||||
Reference in New Issue
Block a user