openjdk-1.8.0/fix-CompactibleFreeListSpace-block_size-crash.patch
2020-09-11 20:18:53 +08:00

14 lines
834 B
Diff

diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index 1a915aa..e5a5501 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -998,7 +998,7 @@ size_t CompactibleFreeListSpace::block_size(const HeapWord* p) const {
// Ensure klass read before size.
Klass* k = oop(p)->klass_or_null_acquire();
- if (k != NULL) {
+ if (k != NULL && Metaspace::contains(k)) {
assert(k->is_klass(), "Should really be klass oop.");
oop o = (oop)p;
assert(o->is_oop(true /* ignore mark word */), "Should be an oop.");