8166727: javac crashed: [jimage.dll+0x1942] ImageStrings::find+0x28

Reviewed-by: iklam, alanb
This commit is contained in:
Jim Laskey 2021-04-05 14:12:26 +00:00
parent 7f9ece23dc
commit a8005efde3
2 changed files with 6 additions and 12 deletions

View file

@ -211,17 +211,6 @@ ImageFileReaderTable::ImageFileReaderTable() : _count(0), _max(_growth) {
assert(_table != NULL && "allocation failed");
}
ImageFileReaderTable::~ImageFileReaderTable() {
for (u4 i = 0; i < _count; i++) {
ImageFileReader* image = _table[i];
if (image != NULL) {
delete image;
}
}
free(_table);
}
// Add a new image entry to the table.
void ImageFileReaderTable::add(ImageFileReader* image) {
if (_count == _max) {

View file

@ -371,7 +371,12 @@ private:
public:
ImageFileReaderTable();
~ImageFileReaderTable();
// ~ImageFileReaderTable()
// Bug 8166727
//
// WARNING: Should never close jimage files.
// Threads may still be running during shutdown.
//
// Return the number of entries.
inline u4 count() { return _count; }