Mono.Cecil.Cil.CodeWriter.IsFatRange C# (CSharp) Method

IsFatRange() static private method

static private IsFatRange ( Instruction start, Instruction end ) : bool
start Instruction
end Instruction
return bool
        static bool IsFatRange(Instruction start, Instruction end)
        {
            if (start == null)
                throw new ArgumentException ();

            if (end == null)
                return true;

            return end.Offset - start.Offset > 255 || start.Offset > 65535;
        }

Usage Example

 private static bool RequiresFatSection(Collection <ExceptionHandler> handlers)
 {
     for (int i = 0; i < handlers.Count; i++)
     {
         ExceptionHandler item = handlers[i];
         if (CodeWriter.IsFatRange(item.TryStart, item.TryEnd))
         {
             return(true);
         }
         if (CodeWriter.IsFatRange(item.HandlerStart, item.HandlerEnd))
         {
             return(true);
         }
         if (item.HandlerType == ExceptionHandlerType.Filter && CodeWriter.IsFatRange(item.FilterStart, item.HandlerStart))
         {
             return(true);
         }
     }
     return(false);
 }