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

Jason Molenda jmolenda at apple.com
Mon Apr 23 19:09:59 PDT 2012


Author: jmolenda
Date: Mon Apr 23 21:09:58 2012
New Revision: 155421

URL: http://llvm.org/viewvc/llvm-project?rev=155421&view=rev
Log:
A small fix for ObjectFileMachO::ParseSymtab() where a pointer
into the middle of a vector was being used after the vector may
have been resized.  
<rdar://problem/11284937>


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=155421&r1=155420&r2=155421&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Apr 23 21:09:58 2012
@@ -2236,10 +2236,14 @@
                                     else
                                     {
                                         // Make a synthetic symbol to describe the trampoline stub
+                                        Mangled stub_symbol_mangled_name(stub_symbol->GetMangled());
                                         if (sym_idx >= num_syms)
+                                        {
                                             sym = symtab->Resize (++num_syms);
+                                            stub_symbol = NULL;  // this pointer no longer valid
+                                        }
                                         sym[sym_idx].SetID (synthetic_sym_id++);
-                                        sym[sym_idx].GetMangled() = stub_symbol->GetMangled();
+                                        sym[sym_idx].GetMangled() = stub_symbol_mangled_name;
                                         sym[sym_idx].SetType (eSymbolTypeTrampoline);
                                         sym[sym_idx].SetIsSynthetic (true);
                                         sym[sym_idx].GetAddress() = so_addr;





More information about the lldb-commits mailing list