public ILEmitter Emit(ILEmitter il, Label gotoNext) { var(x, y) = _arrayComparisonEmitter.EmitLoad(_variable, il, gotoNext); if (_configuration.Get(_variable.OwnerType).IgnoreCollectionOrder) { return(EmitCompareAsSortedArrays(il, gotoNext, x, y)); } var(xEnumerator, yEnumerator) = EmitLoadEnumerators(il, x, y); // todo: 1. think how to use try/finally block // the problem now with the inner `return` statements, it has to be `leave` instruction //il.BeginExceptionBlock(); Loop(il.DefineLabel(out var dispose), xEnumerator, yEnumerator, dispose); //il.BeginFinallyBlock(); EmitDisposeEnumerators(il.MarkLabel(dispose), xEnumerator, yEnumerator); //il.EndExceptionBlock(); return(il.Br(gotoNext)); }