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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 12:38:05 PDT 2017


On Mon, May 8, 2017 at 12:07 PM Greg Clayton <clayborg at gmail.com> wrote:

> 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?
>

I don't think you can do it yourself - probably have to email llvm-admin
(if that's the right name for the list) and/or Chris Lattner - I think it
gets setup along with your SVN access credentials, etc.


>
>
> & 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?
>

Was it failing on buildbots? That's fine then - helpful to mention that in
the commit message in the future.

(& wonder why it didn't fail for you locally before you committed? If it
only fails on some buildbot configurations it might be worth looking at
whether a more general/portable test can be added)


>
> On Mon, May 8, 2017 at 11:40 AM David Blaikie <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> 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
>>> 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
>>>
>>> ==============================================================================
>>> --- 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
>>> 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/4720ad44/attachment.html>


More information about the llvm-commits mailing list