Permalink
Browse files

Fix a case where class->instance_size was not set for dynamic classes.

  • Loading branch information...
vargaz committed Mar 28, 2011
1 parent 13ab89e commit 6d45f250a49dc35347ff15081480d5c2945d4270
Showing with 8 additions and 2 deletions.
  1. +8 −2 mono/metadata/class.c
View
@@ -1669,10 +1669,16 @@ mono_class_layout_fields (MonoClass *class)
if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT)
passes = 1;
- if (class->parent)
+ if (class->parent) {
+ mono_class_setup_fields (class->parent);
+ if (class->parent->exception_type) {
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+ return;
+ }
real_size = class->parent->instance_size;
- else
+ } else {
real_size = sizeof (MonoObject);
+ }
for (pass = 0; pass < passes; ++pass) {
for (i = 0; i < top; i++){

0 comments on commit 6d45f25

Please sign in to comment.