diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp index c309de17b4cad..c1ffd60370b42 100644 --- a/src/hotspot/share/cds/archiveBuilder.cpp +++ b/src/hotspot/share/cds/archiveBuilder.cpp @@ -1201,7 +1201,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic { #undef _LOG_PREFIX // Log information about a region, whose address at dump time is [base .. top). At - // runtime, this region will be mapped to requested_base. requested_base is 0 if this + // runtime, this region will be mapped to requested_base. requested_base is nullptr if this // region will be mapped at os-selected addresses (such as the bitmap region), or will // be accessed with os::read (the header). // @@ -1210,7 +1210,11 @@ class ArchiveBuilder::CDSMapLogger : AllStatic { static void log_region(const char* name, address base, address top, address requested_base) { size_t size = top - base; base = requested_base; - top = requested_base + size; + if (requested_base == nullptr) { + top = (address)size; + } else { + top = requested_base + size; + } log_info(cds, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " %9zu bytes]", name, p2i(base), p2i(top), size); }