Descriptor for a fault block (.fault)
상속: HandlerBlock
예제 #1
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 /// <summary>
 /// Mark this position as the end of the last started block and
 /// make it a fault block.  This fault block is associated with the
 /// specified try block.
 /// </summary>
 /// <param name="tryBlock">the try block associated with this fault block</param>
 public void EndFaultBlock(TryBlock tryBlock)
 {
     Fault fBlock= new Fault((CILLabel)blockStack.Pop(),NewCodedLabel());
     tryBlock.AddHandler(fBlock);
 }
예제 #2
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 internal TryBlock MakeTryBlock(ArrayList labels)
 {
     TryBlock tBlock = new TryBlock(CILInstructions.GetLabel(labels,tryOffset),
         CILInstructions.GetLabel(labels,tryOffset + tryLength));
     CILLabel hStart = CILInstructions.GetLabel(labels,handlerOffset);
     CILLabel hEnd = CILInstructions.GetLabel(labels,handlerOffset+handlerLength);
     HandlerBlock handler = null;
     switch (clauseType) {
         case (EHClauseType.Exception) :
             handler = new Catch((Class)classToken,hStart,hEnd);
             break;
         case (EHClauseType.Filter) :
             handler = new Filter(CILInstructions.GetLabel(labels,filterOffset),hStart,hEnd);
             break;
         case (EHClauseType.Finally) :
             handler = new Finally(hStart,hEnd);
             break;
         case (EHClauseType.Fault) :
             handler = new Fault(hStart,hEnd);
             break;
     }
     tBlock.AddHandler(handler);
     return tBlock;
 }