Skip to content

Commit

Permalink
Move FailFast call so that we do not attempt to synchronize when the …
Browse files Browse the repository at this point in the history
…condition is not met
  • Loading branch information
dibarbet committed Aug 27, 2021
1 parent 4b9dcc5 commit 9a1e743
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Compilers/Core/Portable/InternalUtilities/FailFast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ internal static void DumpStackTrace(Exception? exception = null, string? message
/// <param name="message">An optional message to be recorded in the dump in case of failure. Can be <c>null</c>.</param>
[Conditional("DEBUG")]
[DebuggerHidden]
[MethodImpl(MethodImplOptions.Synchronized)]
internal static void Assert([DoesNotReturnIf(false)] bool condition, string? message = null)
{
if (condition)
Expand All @@ -104,8 +103,7 @@ internal static void Assert([DoesNotReturnIf(false)] bool condition, string? mes
Debugger.Break();
}

DumpStackTrace(message: message);
Environment.FailFast("ASSERT FAILED" + Environment.NewLine + message);
Fail("ASSERT FAILED" + Environment.NewLine + message)
}
}
}

0 comments on commit 9a1e743

Please sign in to comment.