Skip to content

Commit 19ad7a0

Browse files
authored
[lldb] Fix the semantics of SupportFile equivalence (llvm#95606)
Currently, two SupportFiles with the same FileSpec are considered different if one of them has a Checksum and the other doesn't. However, this is overly strict. It's totally valid to mix LineTables that do and do not contain Checksums. This patch makes it so that the Checksum is only compared if both SupportFiles have a valid Checksum.
1 parent 6355fb4 commit 19ad7a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lldb/include/lldb/Utility/SupportFile.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ class SupportFile {
3030

3131
virtual ~SupportFile() = default;
3232

33+
/// Return true if both SupportFiles have the same FileSpec and, if both have
34+
/// a valid Checksum, the Checksum is the same.
3335
bool operator==(const SupportFile &other) const {
34-
return m_file_spec == other.m_file_spec && m_checksum == other.m_checksum;
36+
if (m_checksum && other.m_checksum)
37+
return m_file_spec == other.m_file_spec && m_checksum == other.m_checksum;
38+
return m_file_spec == other.m_file_spec;
3539
}
3640

3741
bool operator!=(const SupportFile &other) const { return !(*this == other); }

0 commit comments

Comments
 (0)