mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-03 06:58:23 +00:00
8351333: [ubsan] CDSMapLogger::log_region applying non-zero offset to null pointer
Reviewed-by: ccheung
This commit is contained in:
parent
898d479800
commit
4e7b513372
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user