diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog index 9fa4f999ce198..2d0b493e5dd99 100644 --- a/mono/interpreter/ChangeLog +++ b/mono/interpreter/ChangeLog @@ -1,4 +1,8 @@ +Tue Mar 26 17:03:14 CET 2002 Paolo Molaro + + * interp.c: support fieldrefs when accessing instance fields. + Mon Mar 25 12:59:52 CET 2002 Paolo Molaro * interp.c: allow tracing to be done on a per-method basis. diff --git a/mono/interpreter/interp.c b/mono/interpreter/interp.c index d041e1ebaed59..af5d072f9fd1a 100644 --- a/mono/interpreter/interp.c +++ b/mono/interpreter/interp.c @@ -2493,7 +2493,13 @@ ves_exec_method (MonoInvocation *frame) if (sp [-1].type == VAL_OBJ) { obj = sp [-1].data.p; - field = mono_class_get_field (obj->vtable->klass, token); + /* if we access a field from our parent and the parent was + * defined in another assembly, we get a memberref. + */ + if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) + field = mono_field_from_memberref (image, token, NULL); + else + field = mono_class_get_field (obj->vtable->klass, token); offset = field->offset; } else { /* valuetype */ /*g_assert (sp [-1].type == VAL_VALUETA); */ @@ -2525,7 +2531,13 @@ ves_exec_method (MonoInvocation *frame) if (sp [0].type == VAL_OBJ) { obj = sp [0].data.p; - field = mono_class_get_field (obj->vtable->klass, token); + /* if we access a field from our parent and the parent was + * defined in another assembly, we get a memberref. + */ + if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) + field = mono_field_from_memberref (image, token, NULL); + else + field = mono_class_get_field (obj->vtable->klass, token); offset = field->offset; } else { /* valuetype */ /*g_assert (sp->type == VAL_VALUETA); */