Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ internal static unsafe void FailFast(string? message = null, Exception? exceptio
}
catch
{
// If ToString() fails (for example, due to OOM), fall back to printing just the type name.
// If ToString() fails (for example, due to OOM), fall back to a simpler message.
try
{
Internal.Console.Error.Write(exception.GetType().FullName);
// Use an allocation-free MethodTable comparison.
Internal.Console.Error.Write(exception.GetMethodTable() == Internal.Runtime.MethodTable.Of<OutOfMemoryException>() ? "Out of memory." : exception.GetType().FullName);
Internal.Console.Error.WriteLine();
}
catch { }
Expand Down
Loading