Skip to content
Permalink
Browse files
Merge pull request #8145 from Techjar/shaderuid-memcmp-fix
VideoCommon/ShaderGenCommon: Fix memcmp size in ShaderUid operators
  • Loading branch information
lioncash committed May 30, 2019
2 parents 00ecfb3 + cd3ba57 commit 8046f40
Showing 1 changed file with 2 additions and 2 deletions.
@@ -69,15 +69,15 @@ class ShaderUid : public ShaderGeneratorInterface

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); }

// 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.

0 comments on commit 8046f40

Please sign in to comment.