[all-commits] [llvm/llvm-project] 085dcc: [clang][Frontend] Fix a crash in DiagnosticRenderer.

Balázs Kéri via All-commits all-commits at lists.llvm.org
Tue Feb 16 23:53:59 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 085dcc82178f94b99783c5730e70a953e4105c00
      https://github.com/llvm/llvm-project/commit/085dcc82178f94b99783c5730e70a953e4105c00
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2021-02-17 (Wed, 17 Feb 2021)

  Changed paths:
    M clang/lib/Frontend/DiagnosticRenderer.cpp
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-begin-1.inc
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-begin-2.inc
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-begin-macro-1.inc
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-begin-macro-2.inc
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-end-macro.inc
    A clang/test/Analysis/copypaste/Inputs/clone-begin-end-different-file-end.inc
    A clang/test/Analysis/copypaste/clone-begin-end-different-file.cpp
    A clang/test/Frontend/crash-diagnostic-renderer.cpp

  Log Message:
  -----------
  [clang][Frontend] Fix a crash in DiagnosticRenderer.

Displaying the problem range could crash if the begin and end of a
range is in different files or macros. After the change such range
is displayed only as the beginning location.

There is a bug for this problem:
https://bugs.llvm.org/show_bug.cgi?id=46540

Reviewed By: steakhal

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




More information about the All-commits mailing list