Make sure R2RDump write to console in case --out is not specified (#2239)
authorAndrew Au <andrewau@microsoft.com>
Mon, 27 Jan 2020 22:21:56 +0000 (14:21 -0800)
committerGitHub <noreply@github.com>
Mon, 27 Jan 2020 22:21:56 +0000 (14:21 -0800)
src/coreclr/src/tools/r2rdump/R2RDump.cs

index dc9e910..dd102d8 100644 (file)
@@ -480,6 +480,10 @@ namespace R2RDump
                 {
                     globalWriter = new StreamWriter(_options.Out.FullName);
                 }
+                else
+                {
+                    globalWriter = Console.Out;
+                }
 
                 foreach (FileInfo filename in _options.In)
                 {
@@ -498,7 +502,7 @@ namespace R2RDump
                         }
                     }
 
-                    if (!_options.Diff && globalWriter != null)
+                    if (!_options.Diff)
                     {
                         _writer = globalWriter;
                     }