diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-01-29 01:15:37 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-01-31 01:44:09 +0300 |
commit | 006aa632c6734d6a6a03863d9ace2761cbc38104 (patch) | |
tree | f7d916973ef64966dbdb4ba8a1daf73a89ed9e12 /src/node_errors.cc | |
parent | 6f217e7ce5f1a0db1b3d31a23efa6a2af8acfecb (diff) |
src: add handle scope to `OnFatalError()`
For the report generation, we use `Environment::GetCurrent(isolate)`
which uses `isolate->GetCurrentContext()` under the hood, thus
allocates a handle. Without a `HandleScope`, this is invalid.
This might not strictly be allowed inside of `OnFatalError()`,
but it won’t make anything worse either.
PR-URL: https://github.com/nodejs/node/pull/25775
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index c7a449c8c50..23a65bd2251 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -319,6 +319,7 @@ void OnFatalError(const char* location, const char* message) { } #ifdef NODE_REPORT Isolate* isolate = Isolate::GetCurrent(); + HandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); if (env != nullptr) { std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options(); |