diff --git a/src/coreclr/ilasm/grammar_after.cpp b/src/coreclr/ilasm/grammar_after.cpp index cbb488ba0c3f51..9d322238c2bb50 100644 --- a/src/coreclr/ilasm/grammar_after.cpp +++ b/src/coreclr/ilasm/grammar_after.cpp @@ -1800,9 +1800,10 @@ void AsmParse::error(const char* fmt, ...) /**************************************************************************/ void AsmParse::warn(const char* fmt, ...) { + if(assem->OnErrGo) return; char *sz = (char*)(&wzUniBuf[(dwUniBuf >> 1)]); char *psz=&sz[0]; - FILE* pF = ((!assem->m_fReportProgress)&&(assem->OnErrGo)) ? stdout : stderr; + FILE* pF = stderr; va_list args; va_start(args, fmt); diff --git a/src/tools/ilasm/src/ilasm/Program.cs b/src/tools/ilasm/src/ilasm/Program.cs index 1619145487a66e..f9df8ad13d9044 100644 --- a/src/tools/ilasm/src/ilasm/Program.cs +++ b/src/tools/ilasm/src/ilasm/Program.cs @@ -234,7 +234,7 @@ byte[] LoadResource(string path) hasErrors = true; Console.Error.WriteLine($"Error: {diagnostic.Location}: {diagnostic.Message}"); } - else if (diagnostic.Severity == DiagnosticSeverity.Warning) + else if (diagnostic.Severity == DiagnosticSeverity.Warning && !errorTolerant) { Console.WriteLine($"Warning: {diagnostic.Location}: {diagnostic.Message}"); }