[all-commits] [llvm/llvm-project] d22140: [llvm-symbolizer] - Fix the crash in GNU output st...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Sat Jan 30 07:37:13 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d22140687500f90830fe416d9c1e317f7c4535d5
      https://github.com/llvm/llvm-project/commit/d22140687500f90830fe416d9c1e317f7c4535d5
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2021-01-30 (Sat, 30 Jan 2021)

  Changed paths:
    M llvm/test/tools/llvm-symbolizer/output-style-inlined.test
    M llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp

  Log Message:
  -----------
  [llvm-symbolizer] - Fix the crash in GNU output style with --no-inlines and missing input file.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48882.

If the input file does not exist (or has a reading error), the
following code will crash if there are two or more input addresses.

```
auto ResOrErr = Symbolizer.symbolizeInlinedCode(
  ModuleName, {Offset, object::SectionedAddress::UndefSection});
Printer << (error(ResOrErr) ? DILineInfo() : ResOrErr.get().getFrame(0));
```

For the first address, `symbolizeInlinedCode` returns an error.
For the second address, `symbolizeInlinedCode` returns an empty result
(not an error) and `.getFrame(0)` will crash.

Differential revision: https://reviews.llvm.org/D95609




More information about the All-commits mailing list