[Mono-list] ves_icall_FieldInfo_SetValueInternal
Paolo Molaro
lupus at ximian.com
Mon Sep 18 09:36:29 EDT 2006
On 09/15/06 Bruce Wilkie wrote:
> i'm seeing a bug where setting a static field uses the class the field is on:
> --------------
> MonoVTable *vtable = mono_class_vtable (mono_object_domain (field), field->klass);
> --------------
>
> consider, however, that the static field is coming from a base class.
> in this case, it seems that vtable should really be the vtable of the
> base class?
Yes, if a static field is defined in class A, you need to use the vtable
of class A to access it. To get the class that defines a field, use the
parent member of the MonoClassField structure.
I have fixed the code in metadata/icall.c: do you have a test case where
you get a MonoReflectionField object for a static field with klass
being a derived class?
Thanks.
lupus
--
-----------------------------------------------------------------
lupus at debian.org debian/rules
lupus at ximian.com Monkeys do it better
More information about the Mono-list
mailing list