< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page
rev 54181 : 8221175: Fix bad function case for controlled JVM crash on PPC64 big-endian
Reviewed-by:

@@ -1723,11 +1723,18 @@
   const size_t      num = (size_t)os::vm_page_size();
 
   const char* const eol = os::line_separator();
   const char* const msg = "this message should be truncated during formatting";
   char * const dataPtr = NULL;  // bad data pointer
-  const void (*funcPtr)(void) = (const void(*)()) 0xF;  // bad function pointer
+  const void (*funcPtr)(void);  // bad function pointer
+
+#if defined(PPC64) && !defined(ABI_ELFv2)
+  unsigned long function_descriptor[] = { 0xF /* function pointer */, 0x0, 0x0 };
+  funcPtr = (const void(*)()) &function_descriptor;
+#else
+  funcPtr = (const void(*)()) 0xF;
+#endif
 
   // Keep this in sync with test/hotspot/jtreg/runtime/ErrorHandling/ErrorHandler.java
   // which tests cases 1 thru 13.
   // Case 14 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java.
   // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java.
< prev index next >