public override void EndFilter()
{
if (this.activeExceptionRegions == null)
throw new InvalidOperationException("EndFilter can only be called from within an exception filter.");
// Get the current exception clause.
var exceptionRegion = this.activeExceptionRegions.Peek();
if (exceptionRegion.Clauses.Count == 0)
throw new InvalidOperationException("EndFilter can only be called from within an exception filter.");
var latestClause = exceptionRegion.Clauses[exceptionRegion.Clauses.Count - 1];
if (latestClause.Type != ExceptionClauseType.Filter)
throw new InvalidOperationException("EndFilter can only be called from within an exception filter.");
Emit2ByteOpCode(0xFE, 0x11, 1, 0);
PopStackOperands(VESType.Int32);
// Record the start of the handler.
latestClause.FilterHandlerStart = this.offset;
// The filter handler has the exception on the top of the stack.
ClearEvaluationStack();
PushStackOperand(VESType.Object);
}