< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 85
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/IL/ExceptionRegion.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Reflection.Metadata
 5{
 6    public readonly struct ExceptionRegion
 7    {
 8        private readonly ExceptionRegionKind _kind;
 9        private readonly int _tryOffset;
 10        private readonly int _tryLength;
 11        private readonly int _handlerOffset;
 12        private readonly int _handlerLength;
 13        private readonly int _classTokenOrFilterOffset;
 14
 15        internal ExceptionRegion(
 16            ExceptionRegionKind kind,
 17            int tryOffset,
 18            int tryLength,
 19            int handlerOffset,
 20            int handlerLength,
 21            int classTokenOrFilterOffset)
 022        {
 023            _kind = kind;
 024            _tryOffset = tryOffset;
 025            _tryLength = tryLength;
 026            _handlerOffset = handlerOffset;
 027            _handlerLength = handlerLength;
 028            _classTokenOrFilterOffset = classTokenOrFilterOffset;
 029        }
 30
 31        public ExceptionRegionKind Kind
 32        {
 033            get { return _kind; }
 34        }
 35
 36        /// <summary>
 37        /// Start IL offset of the try block.
 38        /// </summary>
 39        public int TryOffset
 40        {
 041            get { return _tryOffset; }
 42        }
 43
 44        /// <summary>
 45        /// Length in bytes of try block.
 46        /// </summary>
 47        public int TryLength
 48        {
 049            get { return _tryLength; }
 50        }
 51
 52        /// <summary>
 53        /// Start IL offset of the exception handler.
 54        /// </summary>
 55        public int HandlerOffset
 56        {
 057            get { return _handlerOffset; }
 58        }
 59
 60        /// <summary>
 61        /// Length in bytes of the exception handler.
 62        /// </summary>
 63        public int HandlerLength
 64        {
 065            get { return _handlerLength; }
 66        }
 67
 68        /// <summary>
 69        /// IL offset of the start of the filter block, or -1 if the region is not a filter.
 70        /// </summary>
 71        public int FilterOffset
 72        {
 073            get { return (Kind == ExceptionRegionKind.Filter) ? _classTokenOrFilterOffset : -1; }
 74        }
 75
 76        /// <summary>
 77        /// Returns a TypeRef, TypeDef, or TypeSpec handle if the region represents a catch, nil token otherwise.
 78        /// </summary>
 79        public EntityHandle CatchType
 80        {
 081            get { return (Kind == ExceptionRegionKind.Catch) ? new EntityHandle((uint)_classTokenOrFilterOffset) : defau
 82        }
 83    }
 84}
 85