[Lldb-commits] [lldb] r133377 - /lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Greg Clayton gclayton at apple.com
Sat Jun 18 21:26:01 PDT 2011


Author: gclayton
Date: Sat Jun 18 23:26:01 2011
New Revision: 133377

URL: http://llvm.org/viewvc/llvm-project?rev=133377&view=rev
Log:
Fixed a crasher where we were accessing a symbol with a bad index.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=133377&r1=133376&r2=133377&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Sat Jun 18 23:26:01 2011
@@ -968,7 +968,7 @@
                                 // using nlist_idx in case we ever start trimming entries out
                                 if (symbol_name[0] == '/')
                                     N_SO_index = sym_idx;
-                                else if (minimize && (N_SO_index == sym_idx - 1))
+                                else if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms))
                                 {
                                     const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString();
                                     if (so_path && so_path[0])





More information about the lldb-commits mailing list