diff --git a/lldb/include/lldb/Utility/SupportFile.h b/lldb/include/lldb/Utility/SupportFile.h index 7505d7f345c5d..d65156cea768f 100644 --- a/lldb/include/lldb/Utility/SupportFile.h +++ b/lldb/include/lldb/Utility/SupportFile.h @@ -30,8 +30,12 @@ class SupportFile { virtual ~SupportFile() = default; + /// Return true if both SupportFiles have the same FileSpec and, if both have + /// a valid Checksum, the Checksum is the same. bool operator==(const SupportFile &other) const { - return m_file_spec == other.m_file_spec && m_checksum == other.m_checksum; + if (m_checksum && other.m_checksum) + return m_file_spec == other.m_file_spec && m_checksum == other.m_checksum; + return m_file_spec == other.m_file_spec; } bool operator!=(const SupportFile &other) const { return !(*this == other); }