src/hotspot/share/memory/filemap.cpp
changeset 57584 9d82a35b6ff7
parent 55717 2b4e14968afd
parent 57579 1edf6cc224fb
child 57897 e2e315f1aa63
--- a/src/hotspot/share/memory/filemap.cpp	Mon Jul 29 18:22:55 2019 +0200
+++ b/src/hotspot/share/memory/filemap.cpp	Mon Jul 29 09:59:04 2019 -0700
@@ -1771,7 +1771,9 @@
   }
 
   init_from_file(_fd, is_static);
-  if (!validate_header(is_static)) {
+  // UseSharedSpaces could be disabled if the checking of some of the header fields in
+  // init_from_file has failed.
+  if (!UseSharedSpaces || !validate_header(is_static)) {
     return false;
   }
   return true;