[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 11:40:08 PDT 2017
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/d8d48861/attachment.html>
More information about the llvm-commits
mailing list