[all-commits] [llvm/llvm-project] 216796: [DebugInfo] Fix infinite loop caused by reading pa...

James Henderson via All-commits all-commits at lists.llvm.org
Tue Jan 7 02:24:15 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 216796f234c757b832898adec28d5d523c80dce2
      https://github.com/llvm/llvm-project/commit/216796f234c757b832898adec28d5d523c80dce2
  Author: James Henderson <jh7370 at my.bristol.ac.uk>
  Date:   2020-01-07 (Tue, 07 Jan 2020)

  Changed paths:
    M llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
    M llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

  Log Message:
  -----------
  [DebugInfo] Fix infinite loop caused by reading past debug_line end

If the claimed unit length of a debug line program is such that the line
table would finish past the end of the .debug_line section, an infinite
loop occurs because the data extractor will continue to "read" zeroes
without changing the offset. This previously didn't hit an error because
the line table program handles a series of zeroes as a bad extended
opcode.

This patch fixes the inifinite loop and adds a warning if the program
doesn't fit in the available data.

Reviewed by: JDevlieghere

Differential Revision: https://reviews.llvm.org/D72279




More information about the All-commits mailing list