Merge "Ignore not yet loaded classes during hprof"
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc
index d6a6595..cdb3e2a 100644
--- a/runtime/hprof/hprof.cc
+++ b/runtime/hprof/hprof.cc
@@ -949,6 +949,10 @@
 }
 
 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