[all-commits] [llvm/llvm-project] 30360d: [clang-doc] Add check for pointer validity

Paul Kirth via All-commits all-commits at lists.llvm.org
Fri Jul 22 10:36:46 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 30360d88d42214e75215145c4e73a74aaf93ddfd
      https://github.com/llvm/llvm-project/commit/30360d88d42214e75215145c4e73a74aaf93ddfd
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2022-07-22 (Fri, 22 Jul 2022)

  Changed paths:
    M clang-tools-extra/clang-doc/Representation.cpp

  Log Message:
  -----------
  [clang-doc] Add check for pointer validity

clang-doc would SEGV when running over the Fuchsia code base.
This patch adds a check to avoid dereferencing potentially null pointers
in the Values vector. These pointers were either never valid or had been
invalidated when the underlying pointer in std::unique_ptr was moved from,
hence making it nullptr within the vector.

Reviewed By: phosek

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




More information about the All-commits mailing list