More ClassHelper class validation
Change-Id: Id66d68785b4224c2149bef44c65344c0a60b6a69
diff --git a/src/object_utils.h b/src/object_utils.h
index cb963cc..99768de 100644
--- a/src/object_utils.h
+++ b/src/object_utils.h
@@ -67,11 +67,15 @@
dex_cache_(NULL),
dex_file_(NULL),
interface_type_list_(NULL),
- klass_(c) {
+ klass_(NULL) {
+ if (c != NULL) {
+ ChangeClass(c);
+ }
}
void ChangeClass(const Class* new_c) {
- CHECK(new_c != NULL) << "klass_=" << HexDump(klass_, sizeof(Class), true);
+ CHECK(new_c != NULL) << "klass_=" << klass_ << " " << HexDump(klass_, sizeof(Class), true);
+ CHECK(new_c->IsClass()) << "klass_=" << klass_ << " " << HexDump(klass_, sizeof(Class), true);
if (dex_cache_ != NULL) {
DexCache* new_c_dex_cache = new_c->GetDexCache();
if (new_c_dex_cache != dex_cache_) {