Skip to content

Commit 2fe9886

Browse files
richardlauaddaleax
authored andcommitted
report: fix build warning in node_report.cc
Fixes `maybe-uninitialized` build warning in `src/node_report.cc`. PR-URL: #26265 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 7612574 commit 2fe9886

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/node_report.cc

+3-5
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,14 @@ std::string TriggerNodeReport(Isolate* isolate,
172172
std::cerr << " (errno: " << errno << ")" << std::endl;
173173
return "";
174174
}
175+
outstream = &outfile;
175176

176177
std::cerr << std::endl
177178
<< "Writing Node.js report to file: " << filename << std::endl;
178179
}
179180

180-
// Pass our stream about by reference, not by copying it.
181-
std::ostream& out = outfile.is_open() ? outfile : *outstream;
182-
183-
WriteNodeReport(
184-
isolate, env, message, location, filename, out, stackstr, &tm_struct);
181+
WriteNodeReport(isolate, env, message, location, filename, *outstream,
182+
stackstr, &tm_struct);
185183

186184
// Do not close stdout/stderr, only close files we opened.
187185
if (outfile.is_open()) {

0 commit comments

Comments
 (0)