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

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

[Dotgnu-pnet-commits] CVS: pnet/engine ilrun.c,1.32,1.33


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine ilrun.c,1.32,1.33
Date: Sun, 22 Jun 2003 13:43:59 -0400

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv8737/engine

Modified Files:
        ilrun.c 
Log Message:
Fix bug #3593, call static constructors explicitly for the class with the entry 
point 


Index: ilrun.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/ilrun.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** ilrun.c     22 Jun 2003 17:16:44 -0000      1.32
--- ilrun.c     22 Jun 2003 17:43:57 -0000      1.33
***************
*** 111,114 ****
--- 111,134 ----
  static void version(void);
  
+ static int CallStaticConstructor(ILExecThread *thread, ILMethod * method)
+ {
+       ILClass *classInfo=ILMethod_Owner(method);
+       ILMethod *cctor = 0;
+       while((cctor = (ILMethod *)ILClassNextMemberByKind
+                                       (classInfo, (ILMember *)cctor,
+                                        IL_META_MEMBERKIND_METHOD)) != 0)
+       {
+               if(ILMethod_IsStaticConstructor(cctor))
+               {
+                       if(ILExecThreadCall(thread, cctor, NULL))
+                       {
+                               /* An exception was thrown while executing the 
program */
+                               return 1;
+                       }
+               }
+       }
+       return 0;
+ }
+ 
  int main(int argc, char *argv[])
  {
***************
*** 391,396 ****
        if(args != 0 && !ILExecThreadHasException(thread))
        {
!               retval = 0;
!               if(ILExecThreadCall(thread, method, &retval, args))
                {
                        /* An exception was thrown while executing the program 
*/
--- 411,418 ----
        if(args != 0 && !ILExecThreadHasException(thread))
        {
!               retval = CallStaticConstructor(thread, method);
!               sawException = retval;
!               
!               if(!sawException && ILExecThreadCall(thread, method, &retval, 
args))
                {
                        /* An exception was thrown while executing the program 
*/





reply via email to

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