<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 20, 2015 at 12:13 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dexonsmith<br>
Date: Fri Mar 20 14:13:53 2015<br>
New Revision: 232833<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232833&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232833&view=rev</a><br>
Log:<br>
DebugInfoFinder: Check for null imported entities<br></blockquote><div><br>When do we have null imported entities? Can we just disallow them?<br><br>There used to be a lot of conditionals for null DI* across the debug info handling and in many cases it hid bugs - I've removed any & would like it if we could continue pushing in that direction, rather than going back to the way things were.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Don't use the accessors in `DIImportedEntity` on a null pointer.  (A WIP<br>
patch to make `DIDescriptor` accessors more strict crashes here<br>
otherwise.)<br>
<br>
Modified:<br>
    llvm/trunk/lib/IR/DebugInfo.cpp<br>
<br>
Modified: llvm/trunk/lib/IR/DebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=232833&r1=232832&r2=232833&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=232833&r1=232832&r2=232833&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)<br>
+++ llvm/trunk/lib/IR/DebugInfo.cpp Fri Mar 20 14:13:53 2015<br>
@@ -674,6 +674,8 @@ void DebugInfoFinder::processModule(cons<br>
       DIArray Imports = CU.getImportedEntities();<br>
       for (unsigned i = 0, e = Imports.getNumElements(); i != e; ++i) {<br>
         DIImportedEntity Import = DIImportedEntity(Imports.getElement(i));<br>
+        if (!Import)<br>
+          continue;<br>
         DIDescriptor Entity = Import.getEntity().resolve(TypeIdentifierMap);<br>
         if (Entity.isType())<br>
           processType(DIType(Entity));<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>