Пример #1
0
        private void WriteMethodDataSection(WriterContext ctxt, BlobWriter writer, bool isMoreSects, Func <OpCode, object, Row> findRow)
        {
            writer.Align(4);

            var size  = ExceptionHandlingClauses.Count * 12 + 4;
            var isFat = size > 0xff || ExceptionHandlingClauses.Any(m => m.IsFat());

            var flags = CorILMethodSect.EHTable;

            if (isFat)
            {
                flags |= CorILMethodSect.FatFormat;
            }
            if (isMoreSects)
            {
                flags |= CorILMethodSect.MoreSects;
            }
            writer.WriteByte((byte)flags);

            if (isFat)
            {
                size = ExceptionHandlingClauses.Count * 24 + 4;
                writer.WriteUInt24((uint)size);
            }
            else
            {
                writer.WriteByte((byte)size);
                writer.WriteUInt16(0);
            }

            for (var i = 0; i < ExceptionHandlingClauses.Count; i++)
            {
                ExceptionHandlingClauses[i].Write(ctxt, writer, isFat, findRow);
            }
        }
Пример #2
0
 public void Final()
 {
     if (!AllReadOnly && SeenParameters.Any(b => b.HasValue && !b.Value))
     {
         // Some parameters remained unevaluated
         Fail();
     }
 }