summaryrefslogtreecommitdiff
path: root/src/node_report.cc
diff options
context:
space:
mode:
authorRichard Lau <riclau@uk.ibm.com>2019-02-22 13:22:06 -0500
committerRichard Lau <riclau@uk.ibm.com>2019-02-28 11:31:23 -0500
commit4a10ce68836c9294006f81b8aa74d2b2890bd0c9 (patch)
treeac6c93c95d0eaf9d6f8dda5e77ac3e21b0887872 /src/node_report.cc
parentcd302d70ddd0d1c249a7242ef7eb1b90bf8eb0de (diff)
downloadandroid-node-v8-4a10ce68836c9294006f81b8aa74d2b2890bd0c9.tar.gz
android-node-v8-4a10ce68836c9294006f81b8aa74d2b2890bd0c9.tar.bz2
android-node-v8-4a10ce68836c9294006f81b8aa74d2b2890bd0c9.zip
report: fix build warning in node_report.cc
Fixes `maybe-uninitialized` build warning in `src/node_report.cc`. PR-URL: https://github.com/nodejs/node/pull/26265 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src/node_report.cc')
-rw-r--r--src/node_report.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/node_report.cc b/src/node_report.cc
index a379f0621f..bd6e710041 100644
--- a/src/node_report.cc
+++ b/src/node_report.cc
@@ -172,16 +172,14 @@ std::string TriggerNodeReport(Isolate* isolate,
std::cerr << " (errno: " << errno << ")" << std::endl;
return "";
}
+ outstream = &outfile;
std::cerr << std::endl
<< "Writing Node.js report to file: " << filename << std::endl;
}
- // Pass our stream about by reference, not by copying it.
- std::ostream& out = outfile.is_open() ? outfile : *outstream;
-
- WriteNodeReport(
- isolate, env, message, location, filename, out, stackstr, &tm_struct);
+ WriteNodeReport(isolate, env, message, location, filename, *outstream,
+ stackstr, &tm_struct);
// Do not close stdout/stderr, only close files we opened.
if (outfile.is_open()) {