test: fix volatile for CauseSegfault with clang

PR-URL: https://github.com/nodejs/node/pull/54325
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ivan Trubach 2024-09-08 01:29:24 +03:00 committed by Michaël Zasso
parent 4a840cecfa
commit f7af8ca021
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -72,7 +72,7 @@ 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.
volatile void** d = static_cast<volatile void**>(nullptr);
void* volatile* d = static_cast<void* volatile*>(nullptr);
*d = nullptr;
}