Rationale:
Since pointer is non-null on loop entry, moving the check
into the while loop (rather than after) gives a more friendly
error message in debug mode when something goes wrong.
BUG=
27825731
BUG=
27627004
Change-Id: I2ea67b3ab6c4edc6815fea38a436e5c3c194e540
DCHECK(!IsInterface());
mirror::Class* common_super_class = this;
while (!common_super_class->IsAssignableFrom(klass.Get())) {
- common_super_class = common_super_class->GetSuperClass();
+ mirror::Class* old_common = common_super_class;
+ common_super_class = old_common->GetSuperClass();
+ DCHECK(common_super_class != nullptr) << PrettyClass(old_common);
}
- DCHECK(common_super_class != nullptr);
return common_super_class;
}