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

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

[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_attrs.c,1.20,1.21


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_attrs.c,1.20,1.21
Date: Tue, 11 Mar 2003 01:30:30 -0500

Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv20765/cscc/csharp

Modified Files:
        cs_attrs.c 
Log Message:
Fix attribute handling inside the attribute itself


Index: cs_attrs.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_attrs.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** cs_attrs.c  6 Mar 2003 00:33:13 -0000       1.20
--- cs_attrs.c  11 Mar 2003 06:30:27 -0000      1.21
***************
*** 206,209 ****
--- 206,236 ----
  
  /*
+  * Check if there are any circular semantic analysis cases .
+  * The attribute target might not be distinct from the attribute
+  * itself , like being a nested class or a member of the attribute.
+  */
+ static int IsAttributeTargetDistinct(ILGenInfo *info, ILProgramItem *item,
+                                       ILClass *classInfo)
+ {
+       ILClass *target;
+       if(ILToProgramItem(classInfo)==item)return 0;
+       target= ILProgramItemToClass(item);
+       if(target==NULL)
+       {
+               ILMember *member=ILProgramItemToMember(item);
+               target=ILMember_Owner(member);
+       }
+       while(target!=NULL)
+       {
+               if(ILToProgramItem(classInfo)==ILToProgramItem(target))
+               {
+                       return 0;
+               }
+               target=ILClass_NestedParent(target);
+       }
+       return 1;
+ }
+ 
+ /*
   * Process a single attribute in a section.
   */
***************
*** 316,320 ****
                /* Perform semantic analysis on the attribute type, but only
                   if we aren't trying to apply the attribute to itself */
!               if(ILToProgramItem(classInfo) != item)
                {
                        CSSemProgramItem(info, ILToProgramItem(classInfo));
--- 343,347 ----
                /* Perform semantic analysis on the attribute type, but only
                   if we aren't trying to apply the attribute to itself */
!               if(IsAttributeTargetDistinct(info,item,classInfo))
                {
                        CSSemProgramItem(info, ILToProgramItem(classInfo));





reply via email to

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