Fixed rvalue value evaluation

This commit is contained in:
WerWolv
2021-01-07 01:56:15 +01:00
parent 3f1d9ed366
commit 2dbfbe70af
2 changed files with 23 additions and 15 deletions

View File

@@ -135,6 +135,11 @@ namespace hex {
return __builtin_bswap32(value);
else if (size == 8)
return __builtin_bswap64(value);
else if (size == 16) {
u64 parts[2];
memcpy(parts, &value, size);
return u128(parts[1]) << 64 | u128(parts[0]);
}
else
throw std::invalid_argument("Invalid value size!");
}