Added a check to the Section to make sure we don't
return sections that don't have valid modules.

<rdar://problem/11605824>

llvm-svn: 160141
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index ec19880..6d984f4 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -184,6 +184,11 @@
     {
         so_addr.SetOffset(offset);
         so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
+        
+#ifdef LLDB_CONFIGURATION_DEBUG
+        // For debug builds, ensure that there are no orphaned (i.e., moduleless) sections.
+        assert(GetModule().get());
+#endif
     }
     return true;
 }