<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, May 1, 2017 at 4:07 PM Greg Clayton via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg created this revision.<br>
Herald added a subscriber: mehdi_amini.<br>
<br>
LTO and other fancy linking previously led to DWARF that contained invalid references. We already validate that CU relative references fall into the CU, and the DW_FORM_ref_addr references fall inside the .debug_info section, but we didn't validate that the references pointed to correct DIE offsets. This new verification will ensure that all references refer to actual DIEs and not an offset in between.<br></blockquote><div><br>This seems strictly stronger than the bounds check. Is it worth having the bounds check if we have this stronger check?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any offset, it would match the DIE that mathes the offset _or_ the next DIE. This has been fixed.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D32722" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32722</a><br>
<br>
Files:<br>
  include/llvm/DebugInfo/DWARF/DWARFContext.h<br>
  include/llvm/DebugInfo/DWARF/DWARFUnit.h<br>
  lib/DebugInfo/DWARF/DWARFContext.cpp<br>
  unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp<br>
<br>
</blockquote></div></div>