dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/runtime/System/Reflection ClrField.cs, 1.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/runtime/System/Reflection ClrField.cs, 1.8, 1.9
Date: Thu, 13 Nov 2003 22:18:31 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection
In directory subversions:/tmp/cvs-serv27669/runtime/System/Reflection

Modified Files:
        ClrField.cs 
Log Message:


Make sure that the class constructor is run before a static field is accessed.


Index: ClrField.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/ClrField.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ClrField.cs 8 Oct 2003 15:29:30 -0000       1.8
--- ClrField.cs 13 Nov 2003 22:18:28 -0000      1.9
***************
*** 105,115 ****
        // Get the value associated with this field on an object.
        [MethodImpl(MethodImplOptions.InternalCall)]
!       extern public override Object GetValue(Object obj);
  
        // Set the value associated with this field on an object.
        [MethodImpl(MethodImplOptions.InternalCall)]
!       extern public override void SetValue(Object obj, Object value,
!                                                                               
 BindingFlags invokeAttr,
!                                                                               
 Binder binder, CultureInfo culture);
  
        // Get the type of this field item.
--- 105,144 ----
        // Get the value associated with this field on an object.
        [MethodImpl(MethodImplOptions.InternalCall)]
!       extern internal Object GetValueInternal(Object obj);
! 
!       // Get the value associated with this field on an object.
!       public override Object GetValue(Object obj)
!                       {
!                               if(obj == null)
!                               {
!                                       // Make sure that the class constructor 
has been
!                                       // executed before we access a static 
field.
!                                       RuntimeHelpers.RunClassConstructor
!                                               (DeclaringType.TypeHandle);
!                               }
!                               return GetValueInternal(obj);
!                       }
  
        // Set the value associated with this field on an object.
        [MethodImpl(MethodImplOptions.InternalCall)]
!       extern internal void SetValueInternal
!                               (Object obj, Object value,
!                                BindingFlags invokeAttr, Binder binder,
!                                CultureInfo culture);
! 
!       // Set the value associated with this field on an object.
!       public override void SetValue(Object obj, Object value,
!                                                                 BindingFlags 
invokeAttr,
!                                                                 Binder 
binder, CultureInfo culture)
!                       {
!                               if(obj == null)
!                               {
!                                       // Make sure that the class constructor 
has been
!                                       // executed before we access a static 
field.
!                                       RuntimeHelpers.RunClassConstructor
!                                               (DeclaringType.TypeHandle);
!                               }
!                               SetValueInternal(obj, value, invokeAttr, 
binder, culture);
!                       }
  
        // Get the type of this field item.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]