public override void VisitLocalVarSig(LocalVarSig localvar)
        {
            int start;

            Utilities.ReadCompressedInteger(m_blobData, (int)localvar.BlobIndex, out start);
            localvar.CallingConvention = m_blobData [start];
            localvar.Local             = (localvar.CallingConvention & 0x7) != 0;
            localvar.Count             = Utilities.ReadCompressedInteger(m_blobData, start + 1, out start);
            localvar.LocalVariables    = this.ReadLocalVariables(localvar.Count, m_blobData, start);
        }
        public LocalVarSig GetLocalVarSig(uint index)
        {
            LocalVarSig lv = m_signatures [index] as LocalVarSig;

            if (lv == null)
            {
                lv = new LocalVarSig(index);
                lv.Accept(this);
                m_signatures [index] = lv;
            }
            return(lv);
        }
Esempio n. 3
0
		LocalVarSig GetLocalVarSig (VariableDefinitionCollection vars)
		{
			LocalVarSig lvs = new LocalVarSig ();
			lvs.CallingConvention |= 0x7;
			lvs.Count = vars.Count;
			lvs.LocalVariables = new LocalVarSig.LocalVariable [lvs.Count];
			for (int i = 0; i < lvs.Count; i++) {
				LocalVarSig.LocalVariable lv = new LocalVarSig.LocalVariable ();
				TypeReference type = vars [i].VariableType;

				lv.CustomMods = m_reflectWriter.GetCustomMods (type);

				if (type is PinnedType) {
					lv.Constraint |= Constraint.Pinned;
					type = (type as PinnedType).ElementType;
				}

				if (type is ReferenceType) {
					lv.ByRef = true;
					type = (type as ReferenceType).ElementType;
				}

				lv.Type = m_reflectWriter.GetSigType (type);

				lvs.LocalVariables [i] = lv;
			}
			return lvs;
		}
Esempio n. 4
0
		public uint AddLocalVarSig (LocalVarSig lvs)
		{
			return AddSignature (lvs);
		}
Esempio n. 5
0
		void Write (LocalVarSig.LocalVariable var)
		{
			Write (var.CustomMods);
			if ((var.Constraint & Constraint.Pinned) != 0)
				Write (ElementType.Pinned);
			if (var.ByRef)
				Write (ElementType.ByRef);
			Write (var.Type);
		}
Esempio n. 6
0
		void Write (LocalVarSig.LocalVariable [] vars)
		{
			foreach (LocalVarSig.LocalVariable var in vars)
				Write (var);
		}
Esempio n. 7
0
		public override void VisitLocalVarSig (LocalVarSig localvar)
		{
			m_sigWriter.Write (localvar.CallingConvention);
			Write (localvar.Count);
			Write (localvar.LocalVariables);
		}
Esempio n. 8
0
		public byte [] CompressLocalVar (LocalVarSig.LocalVariable var)
		{
			m_sigWriter.Empty ();
			Write (var);
			return m_sigWriter.ToArray ();
		}
 public uint AddLocalVarSig(LocalVarSig lvs)
 {
     return(AddSignature(lvs));
 }
 public override void VisitLocalVarSig(LocalVarSig localvar)
 {
     m_sigWriter.Write(localvar.CallingConvention);
     Write(localvar.Count);
     Write(localvar.LocalVariables);
 }
Esempio n. 11
0
 public override void VisitLocalVarSig(LocalVarSig localvar)
 {
     int start;
     Utilities.ReadCompressedInteger (m_blobData, (int) localvar.BlobIndex, out start);
     localvar.CallingConvention = m_blobData [start];
     localvar.Local = (localvar.CallingConvention & 0x7) != 0;
     localvar.Count = Utilities.ReadCompressedInteger (m_blobData, start + 1, out start);
     localvar.LocalVariables = ReadLocalVariables (localvar.Count, m_blobData, start);
 }
Esempio n. 12
0
 public LocalVarSig GetLocalVarSig(uint index)
 {
     LocalVarSig lv = m_signatures [index] as LocalVarSig;
     if (lv == null) {
         lv = new LocalVarSig (index);
         lv.Accept (this);
         m_signatures [index] = lv;
     }
     return lv;
 }
Esempio n. 13
0
        public LocalVarSig GetLocalVarSig(VariableDefinitionCollection vars)
        {
            LocalVarSig lvs = new LocalVarSig ();
            lvs.CallingConvention |= 0x7;
            lvs.Count = vars.Count;
            lvs.LocalVariables = new LocalVarSig.LocalVariable [lvs.Count];
            for (int i = 0; i < lvs.Count; i++) {
                lvs.LocalVariables [i] = GetLocalVariableSig (vars [i]);
            }

            return lvs;
        }