mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibCrypto: Add workaround for false -Warray-bounds warning
When building for AArch64 with UBSan enabled, GCC 13.1 reports a false "array out of bounds" error on access to offset `1 * sizeof(u64)`. Changing the order of the stores seems to silence it.
This commit is contained in:
parent
6bcd73a2ff
commit
12a2f741a7
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/12a2f741a7 Pull-request: https://github.com/SerenityOS/serenity/pull/19059 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/gmta ✅
1 changed files with 3 additions and 3 deletions
|
@ -40,10 +40,10 @@ static void export_big_endian(u256 const& value, Bytes data)
|
|||
u64 c = AK::convert_between_host_and_big_endian(value.high().low());
|
||||
u64 d = AK::convert_between_host_and_big_endian(value.high().high());
|
||||
|
||||
ByteReader::store(data.offset_pointer(0 * sizeof(u64)), d);
|
||||
ByteReader::store(data.offset_pointer(1 * sizeof(u64)), c);
|
||||
ByteReader::store(data.offset_pointer(2 * sizeof(u64)), b);
|
||||
ByteReader::store(data.offset_pointer(3 * sizeof(u64)), a);
|
||||
ByteReader::store(data.offset_pointer(2 * sizeof(u64)), b);
|
||||
ByteReader::store(data.offset_pointer(1 * sizeof(u64)), c);
|
||||
ByteReader::store(data.offset_pointer(0 * sizeof(u64)), d);
|
||||
}
|
||||
|
||||
static u256 select(u256 const& left, u256 const& right, bool condition)
|
||||
|
|
Loading…
Reference in a new issue