From caa26be46ad280404a03791001b355e40c1c3963 Mon Sep 17 00:00:00 2001 From: sendaoYan Date: Wed, 18 Dec 2024 15:25:42 +0800 Subject: [PATCH] update comment "Use volatile to prevent compiler from optimising away the store" --- src/hotspot/share/runtime/frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/frame.cpp b/src/hotspot/share/runtime/frame.cpp index 3687b06ae9f7f..b80aa8c4457f6 100644 --- a/src/hotspot/share/runtime/frame.cpp +++ b/src/hotspot/share/runtime/frame.cpp @@ -1163,7 +1163,7 @@ void frame::oops_do_internal(OopClosure* f, NMethodClosure* cf, #ifndef PRODUCT // simulate GC crash here to dump java thread in error report if (CrashGCForDumpingJavaThread) { - volatile char *t = nullptr; // Use volatile modifier to make clang avoid 'dead code' elimination + volatile char *t = nullptr; // Use volatile to prevent compiler from optimising away the store *t = 'c'; } #endif