DiscIO: Add workaround for MSVC ARM64 ICE

This commit is contained in:
Shawn Hoffman 2021-06-29 10:24:09 +02:00 committed by JosJuice
parent 3b3fb9d4c3
commit 30f9f31a69

View File

@ -70,7 +70,7 @@ private:
using SHA1 = std::array<u8, 20>; using SHA1 = std::array<u8, 20>;
using WiiKey = std::array<u8, 16>; using WiiKey = std::array<u8, 16>;
// See docs/WIA.md for details about the format // See docs/WiaAndRvz.md for details about the format
#pragma pack(push, 1) #pragma pack(push, 1)
struct WIAHeader1 struct WIAHeader1
@ -241,25 +241,23 @@ private:
struct ReuseID struct ReuseID
{ {
bool operator==(const ReuseID& other) const // This is a workaround for an ICE in Visual Studio 16.10.0 when making an ARM64 Release build.
{ // Once the ICE has been fixed upstream, we can move partition_key inside the tie.
return std::tie(partition_key, data_size, encrypted, value) == #define COMPARE_TIED(op) \
std::tie(other.partition_key, other.data_size, other.encrypted, other.value); (partition_key op other.partition_key) && \
} std::tie(data_size, encrypted, value) \
bool operator<(const ReuseID& other) const op std::tie(other.data_size, other.encrypted, other.value)
{
return std::tie(partition_key, data_size, encrypted, value) < bool operator==(const ReuseID& other) const { return COMPARE_TIED(==); }
std::tie(other.partition_key, other.data_size, other.encrypted, other.value); bool operator<(const ReuseID& other) const { return COMPARE_TIED(<); }
} bool operator>(const ReuseID& other) const { return COMPARE_TIED(>); }
bool operator>(const ReuseID& other) const
{
return std::tie(partition_key, data_size, encrypted, value) >
std::tie(other.partition_key, other.data_size, other.encrypted, other.value);
}
bool operator!=(const ReuseID& other) const { return !operator==(other); } bool operator!=(const ReuseID& other) const { return !operator==(other); }
bool operator>=(const ReuseID& other) const { return !operator<(other); } bool operator>=(const ReuseID& other) const { return !operator<(other); }
bool operator<=(const ReuseID& other) const { return !operator>(other); } bool operator<=(const ReuseID& other) const { return !operator>(other); }
#undef COMPARE_TIED
const WiiKey* partition_key; const WiiKey* partition_key;
u64 data_size; u64 data_size;
bool encrypted; bool encrypted;