[all-commits] [llvm/llvm-project] 67a84e: [clang] Cleanup ASTContext before output files in ...

Ben Langmuir via All-commits all-commits at lists.llvm.org
Thu Jul 7 10:24:13 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67a84ec8105e590159b6303a1f0e3cb77c02b5fe
      https://github.com/llvm/llvm-project/commit/67a84ec8105e590159b6303a1f0e3cb77c02b5fe
  Author: Ben Langmuir <blangmuir at apple.com>
  Date:   2022-07-07 (Thu, 07 Jul 2022)

  Changed paths:
    M clang/lib/Frontend/CompilerInstance.cpp
    M clang/lib/Frontend/FrontendAction.cpp

  Log Message:
  -----------
  [clang] Cleanup ASTContext before output files in crash recovery for modules

When we recover from a crash in a module compilation thread, we need to
ensure any output streams owned by the ASTConsumer (e.g. in
RawPCHContainerGenerator) are deleted before we call clearOutputFiles().
This has the same theoretical issues with proxy streams that Duncan
discusses in the commit 2d133867833fe8eb. In practice, this was observed
as a use-after-free crash on a downstream branch that uses such a proxy
stream in this code path. Add an assertion so it won't regress.

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

rdar://96525032




More information about the All-commits mailing list