Skip to content

Commit b532a4a

Browse files
committed
8336692: Redo fix for JDK-8284620
Reviewed-by: mdoerr Backport-of: c5b7af73d07f7458e970f5752eb75640562ddc7b
1 parent 9b9027c commit b532a4a

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
@@ -135,10 +135,11 @@ CodeBuffer::~CodeBuffer() {
135135
// Previous incarnations of this buffer are held live, so that internal
136136
// addresses constructed before expansions will not be confused.
137137
cb->free_blob();
138+
}
139+
if (_overflow_arena != nullptr) {
138140
// free any overflow storage
139-
delete cb->_overflow_arena;
141+
delete _overflow_arena;
140142
}
141-
142143
// Claim is that stack allocation ensures resources are cleaned up.
143144
// This is resource clean up, let's hope that all were properly copied out.
144145
NOT_PRODUCT(free_strings();)
@@ -940,8 +941,6 @@ void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
940941
CodeSection* this_sect = code_section(n);
941942
this_sect->take_over_code_from(cb_sect);
942943
}
943-
_overflow_arena = cb->_overflow_arena;
944-
cb->_overflow_arena = NULL;
945944
// Make sure the old cb won't try to use it or free it.
946945
DEBUG_ONLY(cb->_blob = (BufferBlob*)badAddress);
947946
}

0 commit comments

Comments
 (0)