[Lldb-commits] [lldb] r144353 - /lldb/trunk/include/lldb/Core/MappedHash.h

Greg Clayton gclayton at apple.com
Thu Nov 10 17:21:03 PST 2011


Author: gclayton
Date: Thu Nov 10 19:21:03 2011
New Revision: 144353

URL: http://llvm.org/viewvc/llvm-project?rev=144353&view=rev
Log:
Allow the Apple hash tables to be emtpy.


Modified:
    lldb/trunk/include/lldb/Core/MappedHash.h

Modified: lldb/trunk/include/lldb/Core/MappedHash.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=144353&r1=144352&r2=144353&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/MappedHash.h (original)
+++ lldb/trunk/include/lldb/Core/MappedHash.h Thu Nov 10 19:21:03 2011
@@ -380,7 +380,7 @@
             m_hash_offsets (NULL)
         {
             uint32_t offset = m_header.Read (data, 0);
-            if (offset != UINT32_MAX)
+            if (offset != UINT32_MAX && IsValid ())
             {
                 m_hash_indexes = (uint32_t *)data.GetData (&offset, m_header.bucket_count * sizeof(uint32_t));
                 m_hash_values  = (uint32_t *)data.GetData (&offset, m_header.hashes_count * sizeof(uint32_t));
@@ -396,7 +396,10 @@
         bool
         IsValid () const
         {
-            return m_header.version == 1 && m_header.hash_function == eHashFunctionDJB;
+            return m_header.version == 1 && 
+                   m_header.hash_function == eHashFunctionDJB && 
+                   m_header.bucket_count > 0 &&
+                   m_header.hashes_count > 0;
         }
         
         uint32_t





More information about the lldb-commits mailing list