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 <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax committed Jan 30, 2019
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
Expand Up @@ -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();
Expand Down

0 comments on commit 006aa63

Please sign in to comment.