Skip to content

Commit 0949039

Browse files
committed
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: #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>
1 parent d9c2690 commit 0949039

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_errors.cc

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ void OnFatalError(const char* location, const char* message) {
319319
}
320320
#ifdef NODE_REPORT
321321
Isolate* isolate = Isolate::GetCurrent();
322+
HandleScope handle_scope(isolate);
322323
Environment* env = Environment::GetCurrent(isolate);
323324
if (env != nullptr) {
324325
std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();

0 commit comments

Comments
 (0)