[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

Vakhurin Sergei via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 03:49:42 PDT 2024


================
@@ -571,8 +571,7 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc,
   }
 
   // If explicitly requested, map fatal errors to errors.
-  if (Result == diag::Severity::Fatal &&
-      Diag.CurDiagID != diag::fatal_too_many_errors && Diag.FatalsAsError)
----------------
igelbox wrote:

I'm not sure why do we checked for `Diag.CurDiagID != diag::fatal_too_many_errors` here.
Moreover even without this piece of code unit-tests succeed.

https://github.com/llvm/llvm-project/pull/108187


More information about the cfe-commits mailing list