Descriptor for the locals for a method
Inheritance: Signature
Ejemplo n.º 1
0
 internal static void Read(PEReader buff, TableRow[] sigs)
 {
     for (int i=0; i < sigs.Length; i++) {
         uint sigIx = buff.GetBlobIx();
         uint tag = buff.FirstBlobByte(sigIx);
         if (tag == LocalSig.LocalSigByte)
             sigs[i] = new LocalSig(sigIx);
         else if (tag == Field.FieldTag)
             sigs[i] = new Signature(sigIx);
         else
             sigs[i] = new CalliSig(sigIx);
         sigs[i].Row = (uint)i+1;
     }
 }
Ejemplo n.º 2
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Method,this);
     nameIx = md.AddToStringsHeap(name);
     if (genericParams != null) {
         for (int i=0; i < genericParams.Count; i++) {
             ((GenericParam)genericParams[i]).BuildMDTables(md);
         }
     }
     if (security != null) {
         for (int i=0; i < security.Count; i++) {
             ((DeclSecurity)security[i]).BuildMDTables(md);
         }
     }
     if (pinvokeImpl != null) pinvokeImpl.BuildMDTables(md);
     if (entryPoint) md.SetEntryPoint(this);
     if (locals != null) {
         localSig = new LocalSig(locals);
         localSig.BuildMDTables(md);
     }
     try {
         if (code != null) {
             if (code.IsEmpty()) {
                 code = null;
             } else {
                 code.BuildTables(md);
             }
         }
     } catch (InstructionException ex) {
         throw new Exception(ex.AddMethodName(name));
     }
     parIx = md.TableIndex(MDTable.Param);
     for (int i=0; i < sig.numPars; i++) {
         parList[i].seqNo = (ushort)(i+1);
         parList[i].BuildMDTables(md);
     }
     sig.BuildTables(md);
 }