Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EndExceptionBlock()

virtual void System.Reflection.Emit.ILGenerator.EndExceptionBlock ( )
inlinevirtual

Definition at line 783 of file ILGenerator.cs.

784 {
785 if (m_currExcStackCount == 0)
786 {
787 throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
788 }
789 __ExceptionInfo _ExceptionInfo = m_currExcStack[m_currExcStackCount - 1];
791 Label endLabel = _ExceptionInfo.GetEndLabel();
792 switch (_ExceptionInfo.GetCurrentState())
793 {
794 case 0:
795 case 1:
796 throw new InvalidOperationException(SR.Argument_BadExceptionCodeGen);
797 case 2:
798 Emit(OpCodes.Leave, endLabel);
799 break;
800 case 3:
801 case 4:
802 Emit(OpCodes.Endfinally);
803 break;
804 }
805 Label loc = ((m_labelList[endLabel.GetLabelValue()] != -1) ? _ExceptionInfo.m_finallyEndLabel : endLabel);
806 MarkLabel(loc);
807 _ExceptionInfo.Done(m_length);
808 }
virtual void MarkLabel(Label loc)

References System.SR.Argument_BadExceptionCodeGen, System.SR.Argument_NotInExceptionBlock, System.Reflection.Emit.__ExceptionInfo.Done(), System.Reflection.Emit.OpCodes.Endfinally, System.Reflection.Emit.__ExceptionInfo.GetCurrentState(), System.Reflection.Emit.__ExceptionInfo.GetEndLabel(), System.Reflection.Emit.Label.GetLabelValue(), System.Reflection.Emit.OpCodes.Leave, System.Reflection.Emit.ILGenerator.m_currExcStack, System.Reflection.Emit.ILGenerator.m_currExcStackCount, System.Reflection.Emit.__ExceptionInfo.m_finallyEndLabel, System.Reflection.Emit.ILGenerator.m_labelList, System.Reflection.Emit.ILGenerator.m_length, and System.Reflection.Emit.ILGenerator.MarkLabel().

Referenced by System.Dynamic.Utils.DelegateHelpers.CreateObjectArrayDelegateRefEmit(), System.Linq.Expressions.Compiler.LambdaCompiler.EmitTryExpression(), and System.Xml.Serialization.CodeGenerator.EndExceptionBlock().