Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-09-02 15:42:09 +0300
committerShelley Vohr <shelley.vohr@gmail.com>2020-09-04 21:16:17 +0300
commit8bdbacf39b8d51f747a8d8960af8b808d3cf2668 (patch)
tree8b2a4f342ecf93e33b274e4e9642d1532124f681 /src
parent27cf6f7629e101de59b12f1a1bd053a5e6525b59 (diff)
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: https://github.com/nodejs/node/pull/35020 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/env.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/env.cc b/src/env.cc
index 58681cdcccc..4aeabbde886 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -1141,6 +1141,8 @@ uv_key_t Environment::thread_local_env = {};
void Environment::Exit(int exit_code) {
if (options()->trace_exit) {
HandleScope handle_scope(isolate());
+ Isolate::DisallowJavascriptExecutionScope disallow_js(
+ isolate(), Isolate::DisallowJavascriptExecutionScope::CRASH_ON_FAILURE);
if (is_main_thread()) {
fprintf(stderr, "(node:%d) ", uv_os_getpid());