[Lldb-commits] [lldb] r221805 - Avoid crash in InitializeNonZerothFrame if no module found

Ed Maste emaste at freebsd.org
Wed Nov 12 10:49:55 PST 2014


Author: emaste
Date: Wed Nov 12 12:49:54 2014
New Revision: 221805

URL: http://llvm.org/viewvc/llvm-project?rev=221805&view=rev
Log:
Avoid crash in InitializeNonZerothFrame if no module found

After r221575 TestCallStopAndContinue and TestCallThatRestarts started
crashing on FreeBSD with a null temporary_module_sp in
RegisterContextLLDB::InitializeNonZerothFrame().

Modified:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=221805&r1=221804&r2=221805&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Wed Nov 12 12:49:54 2014
@@ -501,7 +501,8 @@ RegisterContextLLDB::InitializeNonZeroth
         uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
         
         ModuleSP temporary_module_sp = temporary_pc.GetModule();
-        if (temporary_module_sp->ResolveSymbolContextForAddress (temporary_pc, resolve_scope, m_sym_ctx) & resolve_scope)
+        if (temporary_module_sp &&
+            temporary_module_sp->ResolveSymbolContextForAddress (temporary_pc, resolve_scope, m_sym_ctx) & resolve_scope)
         {
             if (m_sym_ctx.GetAddressRange (resolve_scope, 0, false,  addr_range))
                 m_sym_ctx_valid = true;





More information about the lldb-commits mailing list