Move static field storage to end of Class instance
Change-Id: I90061999c9eef9d900e4269508b983a61f48b264
diff --git a/src/heap.cc b/src/heap.cc
index 7369804..f86f556 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -103,6 +103,7 @@
Object* Heap::AllocObject(Class* klass, size_t num_bytes) {
DCHECK(klass == NULL
|| klass->descriptor_ == NULL
+ || (klass->IsClassClass() && num_bytes >= sizeof(Class))
|| (klass->object_size_ == (klass->IsArray() ? 0 : num_bytes)));
Object* obj = Allocate(num_bytes);
if (obj != NULL) {