[llvm] r302180 - Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 12:07:46 PDT 2017


> On May 8, 2017, at 11:52 AM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> Hey Greg - could you have your email address updated in the SVN login info, so replies to your commits go to you, rather than bouncing?

I don't know this file. Can you point me to it?
> 
> & this could use a test case :)

It is caught by DWARFVerifier::verifyDebugLineStmtOffsets() with:

      // Make sure we don't get a valid line table back if the offset is wrong.
      assert(LineTable == nullptr);

Still add a test for it?

> On Mon, May 8, 2017 at 11:40 AM David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> wrote:
> Test case?
> 
> On Thu, May 4, 2017 at 11:42 AM Greg Clayton via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: gclayton
> Date: Thu May  4 13:29:44 2017
> New Revision: 302180
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=302180&view=rev <http://llvm.org/viewvc/llvm-project?rev=302180&view=rev>
> Log:
> Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.
> 
> 
> Modified:
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
> 
> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=302180&r1=302179&r2=302180&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=302180&r1=302179&r2=302180&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Thu May  4 13:29:44 2017
> @@ -692,6 +692,10 @@ DWARFContext::getLineTableForUnit(DWARFU
>    if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset))
>      return lt;
> 
> +  // Make sure the offset is good before we try to parse.
> +  if (stmtOffset >= U->getLineSection().size())
> +    return nullptr;
> +
>    // We have to parse it first.
>    DataExtractor lineData(U->getLineSection(), isLittleEndian(),
>                           U->getAddressByteSize());
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170508/2cdbde3b/attachment.html>


More information about the llvm-commits mailing list