8336692: Redo fix for JDK-8284620

Reviewed-by: dlong
This commit is contained in:
Vladimir Kozlov 2024-07-20 15:41:29 +00:00
parent 491b9f5efc
commit c5b7af73d0

View File

@ -135,10 +135,11 @@ CodeBuffer::~CodeBuffer() {
// Previous incarnations of this buffer are held live, so that internal
// addresses constructed before expansions will not be confused.
cb->free_blob();
// free any overflow storage
delete cb->_overflow_arena;
}
if (_overflow_arena != nullptr) {
// free any overflow storage
delete _overflow_arena;
}
if (_shared_trampoline_requests != nullptr) {
delete _shared_trampoline_requests;
}
@ -973,8 +974,6 @@ void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
CodeSection* this_sect = code_section(n);
this_sect->take_over_code_from(cb_sect);
}
_overflow_arena = cb->_overflow_arena;
cb->_overflow_arena = nullptr;
// Make sure the old cb won't try to use it or free it.
DEBUG_ONLY(cb->_blob = (BufferBlob*)badAddress);
}