Skip to content

Commit

Permalink
Tue Mar 26 17:03:14 CET 2002 Paolo Molaro <lupus@ximian.com>
Browse files Browse the repository at this point in the history
	* interp.c: support fieldrefs when accessing instance fields.

svn path=/trunk/mono/; revision=3352
  • Loading branch information
illupus committed Mar 26, 2002
1 parent e953522 commit 5159923
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mono/interpreter/ChangeLog
@@ -1,4 +1,8 @@

Tue Mar 26 17:03:14 CET 2002 Paolo Molaro <lupus@ximian.com>

* interp.c: support fieldrefs when accessing instance fields.

Mon Mar 25 12:59:52 CET 2002 Paolo Molaro <lupus@ximian.com>

* interp.c: allow tracing to be done on a per-method basis.
Expand Down
16 changes: 14 additions & 2 deletions mono/interpreter/interp.c
Expand Up @@ -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); */
Expand Down Expand Up @@ -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); */
Expand Down

0 comments on commit 5159923

Please sign in to comment.