src: lock the thread properly in snapshot builder

Otherwise it can crash DCHECK when V8 expects that at least someone
is locking the current thread.

PR-URL: https://github.com/nodejs/node/pull/56327
Fixes: https://github.com/nodejs/node-v8/issues/294
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
pull/52610/merge
Joyee Cheung 2025-01-07 17:49:10 +01:00 committed by GitHub
parent 75b9c1cdd8
commit 7c3aa9fe85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -962,6 +962,8 @@ ExitCode BuildSnapshotWithoutCodeCache(
}
Isolate* isolate = setup->isolate();
v8::Locker locker(isolate);
{
HandleScope scope(isolate);
TryCatch bootstrapCatch(isolate);