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

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Feb 19 21:13:35 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d4f8a3f394f55b5fde7033bf009e5dacea1a775
      https://github.com/llvm/llvm-project/commit/0d4f8a3f394f55b5fde7033bf009e5dacea1a775
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2021-02-19 (Fri, 19 Feb 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

(cherry picked from commit d22140687500f90830fe416d9c1e317f7c4535d5)




More information about the All-commits mailing list