Address instances of different m_type's should compare differently; closes #173.

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-04-16 18:37:20 +01:00
1 parent 86a68577ff
commit c598c3ba8c
1 file changed
+4 -3
+4 -3
View File
@@ -111,9 +111,10 @@ ATTRIBUTE_HELPER_CPP (Address);
bool operator == (const Address &a, const Address &b)
{
NS_ASSERT (a.m_type == b.m_type ||
a.m_type == 0 ||
b.m_type == 0);
if (a.m_type != b.m_type)
{
return false;
}
NS_ASSERT (a.GetLength() == b.GetLength());
return memcmp (a.m_data, b.m_data, a.m_len) == 0;
}