8187578: BitMap::reallocate should check if old_map is NULL
Reviewed-by: stefank, eosterlund, dholmes
--- a/src/hotspot/share/utilities/bitMap.cpp Tue Oct 10 19:18:36 2017 -0700
+++ b/src/hotspot/share/utilities/bitMap.cpp Fri Sep 15 14:47:13 2017 +0200
@@ -81,8 +81,10 @@
if (new_size_in_words > 0) {
map = allocator.allocate(new_size_in_words);
- Copy::disjoint_words((HeapWord*)old_map, (HeapWord*) map,
- MIN2(old_size_in_words, new_size_in_words));
+ if (old_map != NULL) {
+ Copy::disjoint_words((HeapWord*)old_map, (HeapWord*) map,
+ MIN2(old_size_in_words, new_size_in_words));
+ }
if (new_size_in_words > old_size_in_words) {
clear_range_of_words(map, old_size_in_words, new_size_in_words);