[Lldb-commits] [lldb] r160656 - /lldb/trunk/source/Symbol/Symbol.cpp

Jim Ingham jingham at apple.com
Mon Jul 23 18:31:19 PDT 2012


Author: jingham
Date: Mon Jul 23 20:31:19 2012
New Revision: 160656

URL: http://llvm.org/viewvc/llvm-project?rev=160656&view=rev
Log:
Sanity check the result of Symbol::GetPrologueByteSize - make sure it is not greater than the size of the Symbol returning it.

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

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=160656&r1=160655&r2=160656&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Mon Jul 23 20:31:19 2012
@@ -277,6 +277,12 @@
                                                                         sc))
             {
                 m_type_data = sc.line_entry.range.GetByteSize();
+                // Sanity check - this may be a function in the middle of code that has debug information, but
+                // not for this symbol.  So the line entries surrounding us won't lie inside our function.
+                // In that case, the line entry will be bigger than we are, so we do that quick check and
+                // if that is true, we just return 0.
+                if (m_type_data >= m_addr_range.GetByteSize())
+                    m_type_data = 0;
             }
             else
             {





More information about the lldb-commits mailing list