diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-06-14 14:25:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 14:25:03 -0700 |
commit | 19ad7a046b5cf435ba95c100170fc0e36231d620 (patch) | |
tree | 80ab856281c16db79b11d0e2b90318d765670462 /lldb | |
parent | 6355fb45a5433d90a3f1a342920ff56a7fee7e16 (diff) | |
download | llvm-19ad7a046b5cf435ba95c100170fc0e36231d620.zip llvm-19ad7a046b5cf435ba95c100170fc0e36231d620.tar.gz llvm-19ad7a046b5cf435ba95c100170fc0e36231d620.tar.bz2 |
[lldb] Fix the semantics of SupportFile equivalence (#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.
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Utility/SupportFile.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/include/lldb/Utility/SupportFile.h b/lldb/include/lldb/Utility/SupportFile.h index 7505d7f..d65156ce 100644 --- a/lldb/include/lldb/Utility/SupportFile.h +++ b/lldb/include/lldb/Utility/SupportFile.h @@ -30,8 +30,12 @@ public: 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); } |