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 GitHub
parent 8882a21b04
commit 38974a2eb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,7 +73,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;
}