Skip to content

Commit 00e020b

Browse files
committed
src: disallow JS execution during exit()
This is just an extra safeguard – no JS should run once we’ve decided that we are going to shutdown the process, but we’re opening a handle scope in order to access V8, so make sure that our operations do not lead to JS accidentally being run. PR-URL: #35020 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
1 parent 1dce35d commit 00e020b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/env.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,8 @@ uv_key_t Environment::thread_local_env = {};
950950
void Environment::Exit(int exit_code) {
951951
if (options()->trace_exit) {
952952
HandleScope handle_scope(isolate());
953+
Isolate::DisallowJavascriptExecutionScope disallow_js(
954+
isolate(), Isolate::DisallowJavascriptExecutionScope::CRASH_ON_FAILURE);
953955

954956
if (is_main_thread()) {
955957
fprintf(stderr, "(node:%d) ", uv_os_getpid());

0 commit comments

Comments
 (0)