Esempio n. 1
0
 internal ExceptionHandler(HandlerKind kind, TryBody tryBlock, ILGeneratorLabel handlerStart)
 {
     this.ExceptionType = Dummy.TypeReference;
     this.kind          = kind;
     this.HandlerStart  = handlerStart;
     this.tryBlock      = tryBlock;
 }
Esempio n. 2
0
        private ExceptionHandler BeginHandler(HandlerKind kind)
        //^ requires InTryBody;
        {
            ILGeneratorLabel handlerStart = new ILGeneratorLabel(false);

            this.MarkLabel(handlerStart);
            TryBody          currentTryBody = this.tryBodyStack.Peek();
            ExceptionHandler handler        = new ExceptionHandler(kind, currentTryBody, handlerStart);

            if (currentTryBody.end == null)
            {
                currentTryBody.end = handlerStart;
            }
            else if (this.handlers.Count > 0)
            {
                for (int i = this.handlers.Count - 1; i >= 0; i--)
                {
                    if (this.handlers[i].HandlerEnd == null)
                    {
                        this.handlers[i].HandlerEnd = handlerStart;
                        break;
                    }
                }
            }
            this.handlers.Add(handler);
            return(handler);
        }
Esempio n. 3
0
 internal ExceptionHandler(HandlerKind kind, TryBody tryBlock, ILGeneratorLabel handlerStart)
 {
     this.ExceptionType = Dummy.TypeReference;
       this.kind = kind;
       this.HandlerStart = handlerStart;
       this.tryBlock = tryBlock;
 }