[all-commits] [llvm/llvm-project] fa7e07: [lldb] Fix a off-by-one error in ParseSupportFiles...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Nov 10 14:03:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa7e07ed9995637d84f40b3d29e0449154e73dd5
      https://github.com/llvm/llvm-project/commit/fa7e07ed9995637d84f40b3d29e0449154e73dd5
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-11-10 (Fri, 10 Nov 2023)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

  Log Message:
  -----------
  [lldb] Fix a off-by-one error in ParseSupportFilesFromPrologue (#71984)

This fixes a subtle and previously harmless off-by-one bug in
ParseSupportFilesFromPrologue. The function accounts for the start index
being one-based for DWARF v4 and earlier and zero-based for DWARF v5 and
later. However, the same care wasn't taken for the end index.

This bug existed unnoticed because GetFileByIndex gracefully handles an
invalid index. However, the bug manifested itself after #71458, which
added a call to getFileNameEntry which requires the index to be valid.

No test as the bug cannot be observed without the changes from #71458.
Once that PR is merged, this will be covered by all the DWARF v5 tests.




More information about the All-commits mailing list