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
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2021-12-26 22:51:42 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2022-01-01 21:36:51 +0300
commita4795ada8b0c725cafc6f5e0ffbc864cd09b9db7 (patch)
tree19800b3e98d25a5cd3d4358accf7f1cf1aede50c /src/env.cc
parent69ea6775f456ce33032f3c1de01b07260679a88c (diff)
src: split out async stack corruption detection from inline fn
This is fairly expensive code that unnecessarily bloats the contents of the inline function. PR-URL: https://github.com/nodejs/node/pull/41331 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r--src/env.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/env.cc b/src/env.cc
index 3f76c4bb770..e3e06598a57 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -1196,6 +1196,21 @@ void AsyncHooks::grow_async_ids_stack() {
async_ids_stack_.GetJSArray()).Check();
}
+void AsyncHooks::FailWithCorruptedAsyncStack(double expected_async_id) {
+ fprintf(stderr,
+ "Error: async hook stack has become corrupted ("
+ "actual: %.f, expected: %.f)\n",
+ async_id_fields_.GetValue(kExecutionAsyncId),
+ expected_async_id);
+ DumpBacktrace(stderr);
+ fflush(stderr);
+ if (!env()->abort_on_uncaught_exception())
+ exit(1);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ ABORT_NO_BACKTRACE();
+}
+
void Environment::Exit(int exit_code) {
if (options()->trace_exit) {
HandleScope handle_scope(isolate());