Add DCHECKS for class-defs only being null for Proxy classes
Follow-up to go/aog/518436
Test: ./test.py --host -j50
Bug: 68157595
Change-Id: I4e56d7454caef2023bd367841fb9a57fbecda748
diff --git a/runtime/dex_file_annotations.cc b/runtime/dex_file_annotations.cc
index 6075230..845202f 100644
--- a/runtime/dex_file_annotations.cc
+++ b/runtime/dex_file_annotations.cc
@@ -136,6 +136,7 @@
ObjPtr<mirror::Class> klass = field->GetDeclaringClass();
const DexFile::ClassDef* class_def = klass->GetClassDef();
if (class_def == nullptr) {
+ DCHECK(klass->IsProxyClass());
return nullptr;
}
const DexFile::AnnotationsDirectoryItem* annotations_dir =
@@ -314,6 +315,7 @@
const DexFile& dex_file = klass.GetDexFile();
const DexFile::ClassDef* class_def = klass.GetClassDef();
if (class_def == nullptr) {
+ DCHECK(klass.GetRealClass()->IsProxyClass());
return nullptr;
}
const DexFile::AnnotationsDirectoryItem* annotations_dir =