Skip to content

Commit

Permalink
src: add handle scope to OnFatalError()
Browse files Browse the repository at this point in the history
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: #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>
addaleax committed Jan 30, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
1 parent 6f217e7 commit 006aa63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node_errors.cc
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 006aa63

Please sign in to comment.