Author: amccarth
Date: Tue Feb  9 18:06:50 2016
New Revision: 260331

URL: http://llvm.org/viewvc/llvm-project?rev=260331&view=rev
Log:
Don't dereference the first element of an empty container.

Modified:
    lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=260331&r1=260330&r2=260331&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Tue Feb  9 18:06:50 2016
@@ -56,7 +56,7 @@ Symtab::Resize(size_t count)
     // Clients should grab the mutex from this symbol table and lock it 
manually
     // when calling this function to avoid performance issues.
     m_symbols.resize (count);
-    return &m_symbols[0];
+    return m_symbols.empty() ? nullptr : &m_symbols[0];
 }
 
 uint32_t


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to