1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibJS: Handle OOM in NumericToRawBytes AO

This commit is contained in:
Shannon Booth 2023-06-28 19:44:00 +12:00 committed by Linus Groh
parent ddb7b59af0
commit 81c8e642b9
2 changed files with 6 additions and 6 deletions

View file

@ -230,10 +230,10 @@ static ThrowCompletionOr<Value> atomic_compare_exchange_impl(VM& vm, TypedArrayB
constexpr bool is_little_endian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
// 11. Let expectedBytes be NumericToRawBytes(elementType, expected, isLittleEndian).
auto expected_bytes = numeric_to_raw_bytes<T>(vm, expected, is_little_endian);
auto expected_bytes = MUST_OR_THROW_OOM(numeric_to_raw_bytes<T>(vm, expected, is_little_endian));
// 12. Let replacementBytes be NumericToRawBytes(elementType, replacement, isLittleEndian).
auto replacement_bytes = numeric_to_raw_bytes<T>(vm, replacement, is_little_endian);
auto replacement_bytes = MUST_OR_THROW_OOM(numeric_to_raw_bytes<T>(vm, replacement, is_little_endian));
// FIXME: Implement SharedArrayBuffer case.
// 13. If IsSharedArrayBuffer(buffer) is true, then