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

AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice()

This commit is contained in:
Matthias Zimmerman 2022-06-13 05:20:42 -07:00 committed by Linus Groh
parent c0486f93d4
commit c10d48b72c
12 changed files with 45 additions and 34 deletions

View file

@ -246,7 +246,8 @@ static ThrowCompletionOr<Value> atomic_compare_exchange_impl(GlobalObject& globa
// 14. Else,
// a. Let rawBytesRead be a List of length elementSize whose elements are the sequence of elementSize bytes starting with block[indexedPosition].
auto raw_bytes_read = block.slice(indexed_position, sizeof(T));
// FIXME: Propagate errors.
auto raw_bytes_read = MUST(block.slice(indexed_position, sizeof(T)));
// b. If ByteListEqual(rawBytesRead, expectedBytes) is true, then
// i. Store the individual bytes of replacementBytes into block, starting at block[indexedPosition].