< prev index next >

src/hotspot/share/memory/filemap.cpp

Print this page

        

@@ -1608,11 +1608,13 @@
   if (!open_for_read()) {
     return false;
   }
 
   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;
 }
 
< prev index next >