Skip to content

Commit

Permalink
Fix a case where class->instance_size was not set for dynamic classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Mar 28, 2011
1 parent 13ab89e commit 6d45f25
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mono/metadata/class.c
Expand Up @@ -1669,10 +1669,16 @@ mono_class_layout_fields (MonoClass *class)
if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT) if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT)
passes = 1; 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; real_size = class->parent->instance_size;
else } else {
real_size = sizeof (MonoObject); real_size = sizeof (MonoObject);
}


for (pass = 0; pass < passes; ++pass) { for (pass = 0; pass < passes; ++pass) {
for (i = 0; i < top; i++){ for (i = 0; i < top; i++){
Expand Down

0 comments on commit 6d45f25

Please sign in to comment.