mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
Tests/LibWasm: Don't ignore the result of BigInt::export_data()
Prior to this commit, the test runner was ignoring the result, which meant that values that fit in less than 128 bits were shifted to remove the zero words (which is obviously incorrect).
This commit is contained in:
parent
29665f51aa
commit
55e1ab88ad
Notes:
sideshowbarker
2024-07-17 11:33:34 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/55e1ab88ad Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/286 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 5 additions and 2 deletions
|
@ -285,10 +285,13 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke)
|
|||
}
|
||||
|
||||
u128 bits = 0;
|
||||
(void)argument.as_bigint().big_integer().unsigned_value().export_data({ bit_cast<u8*>(&bits), sizeof(bits) });
|
||||
auto bytes = argument.as_bigint().big_integer().unsigned_value().export_data({ bit_cast<u8*>(&bits), sizeof(bits) });
|
||||
VERIFY(!argument.as_bigint().big_integer().is_negative());
|
||||
|
||||
arguments.append(Wasm::Value(bits));
|
||||
if constexpr (AK::HostIsLittleEndian)
|
||||
arguments.append(Wasm::Value(bits << (128 - bytes * 8)));
|
||||
else
|
||||
arguments.append(Wasm::Value(bits >> (128 - bytes * 8)));
|
||||
break;
|
||||
}
|
||||
case Wasm::ValueType::Kind::FunctionReference:
|
||||
|
|
Loading…
Add table
Reference in a new issue