From 950f1de70bbfff9d4581c3102d2107ca6a4512a7 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 6 Apr 2026 13:25:34 -0700 Subject: [PATCH] [lldb] Fix UUID thombstone Key (#190551) This changes `DenseMapInfo::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. --- lldb/include/lldb/Utility/UUID.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/include/lldb/Utility/UUID.h b/lldb/include/lldb/Utility/UUID.h index 8c8fc41e63d5..c64dd573d9bd 100644 --- a/lldb/include/lldb/Utility/UUID.h +++ b/lldb/include/lldb/Utility/UUID.h @@ -112,6 +112,7 @@ private: friend bool operator>=(const UUID &LHS, const UUID &RHS) { return !(LHS < RHS); } + friend struct llvm::DenseMapInfo; }; } // namespace lldb_private @@ -124,7 +125,9 @@ template <> struct DenseMapInfo { 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>::getHashValue(uuid.GetBytes());