Skip to content

Commit 512fee1

Browse files
committedAug 29, 2022
8292972: Initialize fields if CodeBlobIterator shortcuts without heaps
Reviewed-by: kvn, chagedorn
1 parent a476ec5 commit 512fee1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/hotspot/share/code/codeCache.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : publi
380380
: _only_not_unloading(filter == only_not_unloading)
381381
{
382382
if (Filter::heaps() == NULL) {
383+
// The iterator is supposed to shortcut since we have
384+
// _heap == _end, but make sure we do not have garbage
385+
// in other fields as well.
386+
_code_blob = nullptr;
383387
return;
384388
}
385389
_heap = Filter::heaps()->begin();

0 commit comments

Comments
 (0)
Please sign in to comment.