Merge pull request #8145 from Techjar/shaderuid-memcmp-fix

VideoCommon/ShaderGenCommon: Fix memcmp size in ShaderUid operators
This commit is contained in:
Mat M 2019-05-30 18:00:43 -04:00 committed by GitHub
commit 8046f40784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ public:
bool operator==(const ShaderUid& obj) const
{
return memcmp(&data, &obj.data, data.NumValues() * sizeof(data)) == 0;
return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) == 0;
}
bool operator!=(const ShaderUid& obj) const { return !operator==(obj); }
@ -77,7 +77,7 @@ public:
// determines the storage order inside STL containers
bool operator<(const ShaderUid& obj) const
{
return memcmp(&data, &obj.data, data.NumValues() * sizeof(data)) < 0;
return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) < 0;
}
// Returns a pointer to an internally stored object of the uid_data type.