From 3066a67e6279f7e3896ab545bc6c291d279d2b03 Mon Sep 17 00:00:00 2001 From: Ashutosh Mehra Date: Wed, 2 Jul 2025 13:25:00 +0000 Subject: [PATCH] 8361101: AOTCodeAddressTable::_stubs_addr not initialized/freed properly Reviewed-by: kvn, shade --- src/hotspot/share/code/aotCodeCache.cpp | 3 +++ src/hotspot/share/code/aotCodeCache.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/hotspot/share/code/aotCodeCache.cpp b/src/hotspot/share/code/aotCodeCache.cpp index da0be2403fa..08cd05a64ed 100644 --- a/src/hotspot/share/code/aotCodeCache.cpp +++ b/src/hotspot/share/code/aotCodeCache.cpp @@ -1483,6 +1483,9 @@ AOTCodeAddressTable::~AOTCodeAddressTable() { if (_extrs_addr != nullptr) { FREE_C_HEAP_ARRAY(address, _extrs_addr); } + if (_stubs_addr != nullptr) { + FREE_C_HEAP_ARRAY(address, _stubs_addr); + } if (_shared_blobs_addr != nullptr) { FREE_C_HEAP_ARRAY(address, _shared_blobs_addr); } diff --git a/src/hotspot/share/code/aotCodeCache.hpp b/src/hotspot/share/code/aotCodeCache.hpp index 1595f19e905..fb96a580764 100644 --- a/src/hotspot/share/code/aotCodeCache.hpp +++ b/src/hotspot/share/code/aotCodeCache.hpp @@ -136,6 +136,7 @@ private: public: AOTCodeAddressTable() : _extrs_addr(nullptr), + _stubs_addr(nullptr), _shared_blobs_addr(nullptr), _C1_blobs_addr(nullptr), _extrs_length(0),