From 0e48db7d213cb8073e14683f739c42c475d97801 Mon Sep 17 00:00:00 2001 From: Eugene Rozenfeld Date: Tue, 7 Apr 2020 17:21:46 -0700 Subject: [PATCH] Fix the loop calling clang-tidy. `formatOk` wasn't updated in a thread-safe way, which resulted in errors occasionally not being reported from formatting jobs. Fixes https://github.com/dotnet/runtime/issues/34336 --- src/jit-format/jit-format.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jit-format/jit-format.cs b/src/jit-format/jit-format.cs index 357344cc..036bd91f 100644 --- a/src/jit-format/jit-format.cs +++ b/src/jit-format/jit-format.cs @@ -615,7 +615,10 @@ public static bool RunClangTidy(List filenames, string compileCommands, { Parallel.ForEach(filenames, (filename) => { - formatOk &= DoClangTidyInnerLoop(fix, ignoreErrors, checks, compileCommands, filename, verbose); + if (!DoClangTidyInnerLoop(fix, ignoreErrors, checks, compileCommands, filename, verbose)) + { + formatOk = false; + } }); }