Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2020-02-04 17:52:39 +0300
committerAnna Henningsen <anna@addaleax.net>2020-02-08 01:49:19 +0300
commit3271c40ab102841735aa55f6489fe9df2cd47fcc (patch)
tree3684cc602102e1b1b731a57ea55593c28377c973 /src/node_errors.cc
parentd394dd78de600e89ceea02b3582435e50f249aa4 (diff)
src: remove fixed-size GetHumanReadableProcessName
Remove the version of GetHumanReadableProcessName() that operates on a fixed-size buffer. The only remaining caller is Assert() which might get called in contexts where dynamically allocating memory isn't possible but as Assert() calls printf(), which also allocates memory when necessary, this commit is unlikely to make matters much worse. PR-URL: https://github.com/nodejs/node/pull/31633 Fixes: https://github.com/nodejs/node/issues/31631 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r--src/node_errors.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index f82054c339b..9d038e3d168 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -242,12 +242,11 @@ void AppendExceptionLine(Environment* env,
}
[[noreturn]] void Assert(const AssertionInfo& info) {
- char name[1024];
- GetHumanReadableProcessName(&name);
+ std::string name = GetHumanReadableProcessName();
fprintf(stderr,
"%s: %s:%s%s Assertion `%s' failed.\n",
- name,
+ name.c_str(),
info.file_line,
info.function,
*info.function ? ":" : "",