public virtual void AddExceptionHandler(int startLabel, int endLabel, int handlerLabel, string catchClassName)
{
if ((startLabel & unchecked((int)(0x80000000))) != unchecked((int)(0x80000000)))
{
throw new ArgumentException("Bad startLabel");
}
if ((endLabel & unchecked((int)(0x80000000))) != unchecked((int)(0x80000000)))
{
throw new ArgumentException("Bad endLabel");
}
if ((handlerLabel & unchecked((int)(0x80000000))) != unchecked((int)(0x80000000)))
{
throw new ArgumentException("Bad handlerLabel");
}
short catch_type_index = (catchClassName == null) ? 0 : itsConstantPool.AddClass(catchClassName);
ExceptionTableEntry newEntry = new ExceptionTableEntry(startLabel, endLabel, handlerLabel, catch_type_index);
int N = itsExceptionTableTop;
if (N == 0)
{
itsExceptionTable = new ExceptionTableEntry[ExceptionTableSize];
}
else
{
if (N == itsExceptionTable.Length)
{
ExceptionTableEntry[] tmp = new ExceptionTableEntry[N * 2];
System.Array.Copy(itsExceptionTable, 0, tmp, 0, N);
itsExceptionTable = tmp;
}
}
itsExceptionTable[N] = newEntry;
itsExceptionTableTop = N + 1;
}