Skip to content

Commit 29cfbec

Browse files
author
duke
committed
Backport c5b7af73d07f7458e970f5752eb75640562ddc7b
1 parent a021113 commit 29cfbec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hotspot/share/asm/codeBuffer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ CodeBuffer::~CodeBuffer() {
134134
// Previous incarnations of this buffer are held live, so that internal
135135
// addresses constructed before expansions will not be confused.
136136
cb->free_blob();
137+
}
138+
if (_overflow_arena != nullptr) {
137139
// free any overflow storage
138-
delete cb->_overflow_arena;
140+
delete _overflow_arena;
139141
}
140-
141142
if (_shared_trampoline_requests != nullptr) {
142143
delete _shared_trampoline_requests;
143144
}
@@ -959,8 +960,6 @@ void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
959960
CodeSection* this_sect = code_section(n);
960961
this_sect->take_over_code_from(cb_sect);
961962
}
962-
_overflow_arena = cb->_overflow_arena;
963-
cb->_overflow_arena = nullptr;
964963
// Make sure the old cb won't try to use it or free it.
965964
DEBUG_ONLY(cb->_blob = (BufferBlob*)badAddress);
966965
}

0 commit comments

Comments
 (0)