<div dir="ltr">I was reading in chronological order and was wondering why we started hardening LLD for broken inputs at the moment, and finally reached <a href="https://llvm.org/bugs/show_bug.cgi?id=30540">https://llvm.org/bugs/show_bug.cgi?id=30540</a>. I agree that that's a good thing to do.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 28, 2016 at 1:08 PM, Rafael Ávila de Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">rafael added inline comments.<br>
<span class=""><br>
================<br>
Comment at: ELF/InputFiles.cpp:84<br>
@@ -83,3 +83,3 @@<br>
   uint32_t FirstNonLocal = Symtab->sh_info;<br>
-  if (FirstNonLocal > NumSymbols)<br>
+  if (!FirstNonLocal || (FirstNonLocal > NumSymbols))<br>
</span>     fatal(getFilename(this) + ": invalid sh_info in symbol table");<br>
----------------<br>
<span class="">davide wrote:<br>
> ruiu wrote:<br>
> > Probably `FirstNonLocal == 0` is better as we all know that 0 is not a valid symbol index.<br>
> Agree.<br>
</span>Do you need this check in here to avoid the crash? How was it crashing before getting to the other check you added in Writer?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25016" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25016</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>