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

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

[Dotgnu-pnet-commits] CVS: pnet/codegen cg_decls.tc,1.50,1.51


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/codegen cg_decls.tc,1.50,1.51
Date: Fri, 05 Sep 2003 03:45:13 -0400

Update of /cvsroot/dotgnu-pnet/pnet/codegen
In directory subversions:/tmp/cvs-serv24142/codegen

Modified Files:
        cg_decls.tc 
Log Message:


Convert instances of "SecurityPermissionAttribute" into security declarations;
update the compiler and assembler to process security declarations.


Index: cg_decls.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_decls.tc,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** cg_decls.tc 25 Jun 2003 13:03:33 -0000      1.50
--- cg_decls.tc 5 Sep 2003 07:45:11 -0000       1.51
***************
*** 35,38 ****
--- 35,39 ----
        unsigned long valueLen;
        unsigned long posn;
+       ILDeclSecurity *decl;
  
        attr = 0;
***************
*** 65,68 ****
--- 66,105 ----
                }
                putc('\n', stream);
+       }
+ 
+       /* Dump declarative security blobs as well */
+       if(ILProgramItemToAssembly(item) ||
+          ILProgramItemToClass(item) ||
+          ILProgramItemToMethod(item))
+       {
+               decl = ILDeclSecurityGetFromOwner(item);
+               if(decl)
+               {
+                       static char * const actionNames[] = {
+                               "demand /*nil*/", "request", "demand", "assert",
+                               "deny", "permitonly", "linkcheck", 
"inheritcheck",
+                               "reqmin", "reqopt", "reqrefuse", "prejitgrant",
+                               "prejitdeny", "noncasdemand", 
"noncaslinkdemand",
+                               "nocasinheritance"
+                       };
+                       fputs(".capability ", stream);
+                       fputs(actionNames[ILDeclSecurity_Type(decl) &
+                                                         
IL_META_SECURITY_ACTION_MASK], stream);
+                       fputs(" = (", stream);
+                       value = ILDeclSecurityGetBlob(decl, &valueLen);
+                       if(value && valueLen)
+                       {
+                               for(posn = 0; posn < valueLen; ++posn)
+                               {
+                                       if(posn != 0)
+                                       {
+                                               putc(' ', stream);
+                                       }
+                                       fprintf(stream, "%02X",
+                                                       (int)(((const unsigned 
char *)value)[posn]));
+                               }
+                       }
+                       fputs(")\n", stream);
+               }
        }
  }





reply via email to

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