[Lldb-commits] [lldb] [lldb] Fix UUID thombstone Key (PR #190551)

via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 5 15:05:01 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

This changes `DenseMapInfo<UUID>::getTombstoneKey()` to return a 1-byte `{0xFF}` sentinel instead of the empty, default constructed UUID(). Returning the same key for the empty and tombstone value apparently violates the `DenseMap` invariant.

---
Full diff: https://github.com/llvm/llvm-project/pull/190551.diff


1 Files Affected:

- (modified) lldb/include/lldb/Utility/UUID.h (+4-1) 


``````````diff
diff --git a/lldb/include/lldb/Utility/UUID.h b/lldb/include/lldb/Utility/UUID.h
index 8c8fc41e63d50..c64dd573d9bd0 100644
--- a/lldb/include/lldb/Utility/UUID.h
+++ b/lldb/include/lldb/Utility/UUID.h
@@ -112,6 +112,7 @@ class UUID {
   friend bool operator>=(const UUID &LHS, const UUID &RHS) {
     return !(LHS < RHS);
   }
+  friend struct llvm::DenseMapInfo<UUID>;
 };
 } // namespace lldb_private
 
@@ -124,7 +125,9 @@ template <> struct DenseMapInfo<lldb_private::UUID> {
     return lldb_private::UUID();
   }
   static inline lldb_private::UUID getTombstoneKey() {
-    return lldb_private::UUID();
+    lldb_private::UUID key;
+    key.m_bytes = {0xFF};
+    return key;
   }
   static unsigned getHashValue(lldb_private::UUID uuid) {
     return DenseMapInfo<llvm::ArrayRef<uint8_t>>::getHashValue(uuid.GetBytes());

``````````

</details>


https://github.com/llvm/llvm-project/pull/190551


More information about the lldb-commits mailing list