[all-commits] [llvm/llvm-project] 88ee91: [ASTimporter] Remove decl from lookup only if it h...

Balazs Benics via All-commits all-commits at lists.llvm.org
Tue May 18 00:44:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88ee91cd87794813f4394f82d2c693c8d766e1d2
      https://github.com/llvm/llvm-project/commit/88ee91cd87794813f4394f82d2c693c8d766e1d2
  Author: Balazs Benics <balazs.benics at sigmatechnology.se>
  Date:   2021-05-18 (Tue, 18 May 2021)

  Changed paths:
    M clang/lib/AST/ASTImporter.cpp
    M clang/unittests/AST/ASTImporterTest.cpp

  Log Message:
  -----------
  [ASTimporter] Remove decl from lookup only if it has decl context

In the case of TypedefDecls we set the DeclContext after we imported it.
It turns out, it could lead to null pointer dereferences during the
cleanup part of a failed import.

This patch demonstrates this issue and fixes it by checking if the
DeclContext is available or not.

Reviewed By: shafik

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




More information about the All-commits mailing list