diff options
-rw-r--r-- | runtime/hprof/hprof.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc index d6a6595127..cdb3e2af79 100644 --- a/runtime/hprof/hprof.cc +++ b/runtime/hprof/hprof.cc @@ -949,6 +949,10 @@ void Hprof::DumpHeapObject(mirror::Object* obj) { } void Hprof::DumpHeapClass(mirror::Class* klass) { + if (!klass->IsLoaded() && !klass->IsErroneous()) { + // Class is allocated but not yet loaded: we cannot access its fields or super class. + return; + } size_t sFieldCount = klass->NumStaticFields(); if (sFieldCount != 0) { int byteLength = sFieldCount * sizeof(JValue); // TODO bogus; fields are packed |