HomePhabricator

[Clang][Driver] In -fintegrated-cc1 mode, avoid crashing on exit after a…

Authored by aganea on Mar 13 2020, 5:15 AM.

Description

[Clang][Driver] In -fintegrated-cc1 mode, avoid crashing on exit after a compiler crash

After a crash catched by the CrashRecoveryContext, this patch prevents from accessing dangling pointers in TimerGroup structures before the clang tool exits. Previously, the default TimerGroup had internal linked lists which were still pointing to old Timer or TimerGroup instances, which lived in stack frames released by the CrashRecoveryContext.

Fixes PR45164.

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

(cherry picked from commit 28ad9fc20823678881baa0d723834b88ea9e8e3a)