OSDN Git Service

Take into account that we might end up with unresolved classes.
authorCalin Juravle <calin@google.com>
Wed, 29 Jul 2015 18:25:24 +0000 (19:25 +0100)
committerCalin Juravle <calin@google.com>
Wed, 29 Jul 2015 18:25:24 +0000 (19:25 +0100)
bug:22821472
Change-Id: I615ab0b41c8cadae9f327e07dcff71755f7146c2

compiler/optimizing/reference_type_propagation.cc

index f747fc5..d1c1134 100644 (file)
@@ -440,8 +440,10 @@ void RTPVisitor::VisitLoadClass(HLoadClass* instr) {
       Runtime::Current()->GetClassLinker()->FindDexCache(instr->GetDexFile());
   // Get type from dex cache assuming it was populated by the verifier.
   mirror::Class* resolved_class = dex_cache->GetResolvedType(instr->GetTypeIndex());
-  DCHECK(resolved_class != nullptr);
-  ReferenceTypeInfo::TypeHandle handle = handles_->NewHandle(resolved_class);
+  // TODO: investigating why we are still getting unresolved classes: b/22821472.
+  ReferenceTypeInfo::TypeHandle handle = (resolved_class != nullptr)
+    ? handles_->NewHandle(resolved_class)
+    : object_class_handle_;
   instr->SetLoadedClassRTI(ReferenceTypeInfo::Create(handle, /* is_exact */ true));
   instr->SetReferenceTypeInfo(ReferenceTypeInfo::Create(class_class_handle_, /* is_exact */ true));
 }