Skip to content

Commit

Permalink
fix crash due to uninitilized pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
stooke committed Dec 9, 2024
1 parent 0bdef60 commit c2dc01c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/hotspot/os/bsd/memMapPrinter_macosx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ class MappingInfo {
stringStream _file_name;
const char* _tag_text;

MappingInfo() {}
MappingInfo() : _address(nullptr), _size(0), _tag_text(nullptr) {}

void reset() {
_share_buffer.reset();
_protect_buffer.reset();
_type_buffer.reset();
_file_name.reset();
_tag_text = "";
_tag_text = nullptr;
}

bool canCombine(const proc_regionwithpathinfo& mem_info) {
Expand Down Expand Up @@ -277,7 +277,7 @@ class ProcSmapsPrinter {
st->print(" ");
} else {
const char* tag = mapping_info._tag_text;
if (tag != NULL) {
if (tag != nullptr) {
st->print("[%s] ", tag);
}
}
Expand Down Expand Up @@ -361,10 +361,6 @@ void MemMapPrinter::pd_print_all_mappings(const MappingPrintSession& session) {
if (is_interesting(region_info_with_path)) {
if (mapping_info.canCombine(region_info_with_path)) {
mapping_info.combineWithFollowing(region_info_with_path);
// if this region size is not 128GB, it is the last of a set
if (region_info.pri_size != MACOS_PARTIAL_ALLOCATION_SIZE) {

}
} else {
// print previous mapping info
// avoid printing the empty info at the start
Expand Down

0 comments on commit c2dc01c

Please sign in to comment.