[all-commits] [llvm/llvm-project] 9aea66: [symbolizer] Change the ErrorHandler from llvm::fu...

Haojian Wu via All-commits all-commits at lists.llvm.org
Fri Nov 8 07:01:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9aea6671085f02e6127750103ca48ae6a09ceeb8
      https://github.com/llvm/llvm-project/commit/9aea6671085f02e6127750103ca48ae6a09ceeb8
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-11-08 (Fri, 08 Nov 2024)

  Changed paths:
    M llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h

  Log Message:
  -----------
  [symbolizer] Change the ErrorHandler from llvm::function_ref to std::function. (#115477)

This fixes dangling `ErrorHandler` references
([here](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp#L48-L53)
is an example).

`llvm::function_ref` doesn't own the callable, and it is not safe to
store a function_ref (the `PlainPrinterBase` stores a
`llvm::function_ref` which can easily lead to dangling references).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list