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 lib_type.c,1.35,1.36


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine lib_type.c,1.35,1.36
Date: Sat, 19 Jul 2003 12:48:44 -0400

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

Modified Files:
        lib_type.c 
Log Message:
Enable GetType of array expressions like "System.Int32[]".


Index: lib_type.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_type.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** lib_type.c  18 Jul 2003 07:41:21 -0000      1.35
--- lib_type.c  19 Jul 2003 16:48:41 -0000      1.36
***************
*** 317,322 ****
--- 317,324 ----
        ILInt32 nameSpecial;
        int brackets;
+       int rank;
        ILProgramItem *scope;
        ILClass *classInfo;
+       ILType *typeInfo;
  
        /* Validate the parameters */
***************
*** 547,563 ****
        }
  
        /* Resolve special suffixes for array and pointer designations */
        if(nameSpecial < nameEnd)
        {
!               /* TODO */
!               if(throwOnError)
                {
!                       ThrowTypeLoad(thread, name);
                }
-               return 0;
        }
  
        /* Convert the class information block into a "ClrType" instance */
!       return _ILGetClrType(thread, classInfo);
  }
  
--- 549,614 ----
        }
  
+       typeInfo = ILClassToType(classInfo);
+ 
        /* Resolve special suffixes for array and pointer designations */
        if(nameSpecial < nameEnd)
        {
!               posn=nameSpecial;
!               brackets=0;
!               rank=0;
!               while(posn < nameEnd)
                {
!                       switch(buf[posn])
!                       {
!                               case '[':
!                               {
!                                       rank=1;
!                                       brackets++;
!                               }
!                               break;
!                               
!                               case ']':
!                               {
!                                       if(brackets==0)
!                                       {
!                                               if(throwOnError)
!                                               {
!                                                       ThrowTypeLoad(thread, 
name);
!                                               }
!                                               return 0;
!                                       }
!                                       typeInfo = ILTypeFindOrCreateArray(
!                                                                       
thread->process->context,
!                                                                       
(unsigned long) rank,
!                                                                       
typeInfo);
!                                       rank=0;
!                                       brackets--;
!                               }
!                               break;
! 
!                               case ',':
!                               {
!                                       rank++;
!                               }
!                               break;
! 
!                               case '*': /* TODO */
!                               case '&': /* TODO */
!                               default:
!                               {
!                                       if(throwOnError)
!                                       {
!                                               ThrowTypeLoad(thread, name);
!                                       }
!                                       return 0;
!                               }
!                               break;
!                       }
!                       posn++;
                }
        }
  
        /* Convert the class information block into a "ClrType" instance */
!       return _ILGetClrTypeForILType(thread, typeInfo);
  }
  





reply via email to

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