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);
        }
예제 #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;
		}
예제 #4
0
		public uint AddLocalVarSig (LocalVarSig lvs)
		{
			return AddSignature (lvs);
		}
예제 #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);
		}
예제 #6
0
		void Write (LocalVarSig.LocalVariable [] vars)
		{
			foreach (LocalVarSig.LocalVariable var in vars)
				Write (var);
		}
예제 #7
0
		public override void VisitLocalVarSig (LocalVarSig localvar)
		{
			m_sigWriter.Write (localvar.CallingConvention);
			Write (localvar.Count);
			Write (localvar.LocalVariables);
		}
예제 #8
0
		public byte [] CompressLocalVar (LocalVarSig.LocalVariable var)
		{
			m_sigWriter.Empty ();
			Write (var);
			return m_sigWriter.ToArray ();
		}
예제 #9
0
 public uint AddLocalVarSig(LocalVarSig lvs)
 {
     return(AddSignature(lvs));
 }
예제 #10
0
 public override void VisitLocalVarSig(LocalVarSig localvar)
 {
     m_sigWriter.Write(localvar.CallingConvention);
     Write(localvar.Count);
     Write(localvar.LocalVariables);
 }
예제 #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);
 }
예제 #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;
 }
예제 #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;
        }