mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
src: fix backtrace with tail [[noreturn]] abort
A function tail calls [[noreturn]] node::Abort will print an incorrect call stack because the frame pc was advanced when calling node::Abort to an invalid op, which may vary on different platforms. Dumps the backtrace in the ABORT macro instead to avoid calling backtrace in a tail [[noreturn]] call. Removes the [[noreturn]] attribute if a function calls backtrace and may be called as a tail statement. [[noreturn]] attribute of public functions like `napi_fatal_error` and `node::OnFatalError` can not be removed as compilers may complain about no return values after the removal. PR-URL: https://github.com/nodejs/node/pull/50849 Refs: https://github.com/nodejs/node/issues/50761 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
@@ -734,7 +734,7 @@ Maybe<bool> InitializeContextRuntime(Local<Context> context) {
|
||||
}
|
||||
} else if (per_process::cli_options->disable_proto != "") {
|
||||
// Validated in ProcessGlobalArgs
|
||||
OnFatalError("InitializeContextRuntime()", "invalid --disable-proto mode");
|
||||
UNREACHABLE("invalid --disable-proto mode");
|
||||
}
|
||||
|
||||
return Just(true);
|
||||
|
||||
Reference in New Issue
Block a user