summaryrefslogtreecommitdiff
path: root/src/node_process_methods.cc
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2019-06-17 07:58:58 +0200
committerAnna Henningsen <anna@addaleax.net>2019-06-19 15:23:00 -0700
commit264cb79bc2e22cc56fbbd742b8c7bf723e9ce5e2 (patch)
tree9b3f4caff7fab8f450712bacc29027edc46ccaa8 /src/node_process_methods.cc
parent05b8526a594db8be5621ea40de625c46fcd5f1dc (diff)
downloadandroid-node-v8-264cb79bc2e22cc56fbbd742b8c7bf723e9ce5e2.tar.gz
android-node-v8-264cb79bc2e22cc56fbbd742b8c7bf723e9ce5e2.tar.bz2
android-node-v8-264cb79bc2e22cc56fbbd742b8c7bf723e9ce5e2.zip
src: silence compiler warning node_process_methods
Currently, the following compiler warning is generated by clang: ../src/node_process_methods.cc:71:3: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference] *static_cast<volatile void**>(nullptr) = nullptr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/node_process_methods.cc:71:3: note: consider using __builtin_trap() or qualifying pointer with 'volatile' 1 warning generated. This commit adds the volatile qualifier to avoid this warning. PR-URL: https://github.com/nodejs/node/pull/28261 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_process_methods.cc')
-rw-r--r--src/node_process_methods.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc
index 912ac9bec2..b34cbf89b6 100644
--- a/src/node_process_methods.cc
+++ b/src/node_process_methods.cc
@@ -66,7 +66,8 @@ static void Abort(const FunctionCallbackInfo<Value>& args) {
// For internal testing only, not exposed to userland.
static void CauseSegfault(const FunctionCallbackInfo<Value>& args) {
// This should crash hard all platforms.
- *static_cast<void**>(nullptr) = nullptr;
+ volatile void** d = static_cast<volatile void**>(nullptr);
+ *d = nullptr;
}
static void Chdir(const FunctionCallbackInfo<Value>& args) {