[all-commits] [llvm/llvm-project] 967eba: Fix null ptr crash dumping TemplateTemplateParmDecl

David Tolnay via All-commits all-commits at lists.llvm.org
Sat Apr 24 09:28:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 967ebad12521f3187014a722804c27a75d44e649
      https://github.com/llvm/llvm-project/commit/967ebad12521f3187014a722804c27a75d44e649
  Author: David Tolnay <dtolnay at gmail.com>
  Date:   2021-04-24 (Sat, 24 Apr 2021)

  Changed paths:
    M clang/lib/AST/JSONNodeDumper.cpp
    M clang/test/AST/ast-dump-template-decls-json.cpp

  Log Message:
  -----------
  Fix null ptr crash dumping TemplateTemplateParmDecl

The following program winds up with
D->getDefaultArgStorage().getInheritedFrom() == nullptr
during dumping the TemplateTemplateParmDecl corresponding to the
template parameter of i.

  template <typename>
  struct R;
  template <template <typename> class = R>
  void i();

This patch fixes the null pointer dereference.




More information about the All-commits mailing list