private static void YieldBlockBreak(RuntimeFlowControl rfc, BlockParam /*!*/ ownerBlockFlowControl, BlockParam /*!*/ yieldedBlockFlowControl, object returnValue)
{
Assert.NotNull(ownerBlockFlowControl, yieldedBlockFlowControl);
// target proc-converter:
RuntimeFlowControl targetFrame = yieldedBlockFlowControl.TargetFrame;
Debug.Assert(targetFrame != null);
if (targetFrame.IsActiveMethod)
{
if (targetFrame == rfc)
{
// The current primary super-frame is the proc-converter, however we are still in the block frame that needs to be unwound.
// Sets the owner's BFC to exit the current block (recursively up to the primary frame).
ownerBlockFlowControl.SetFlowControl(BlockReturnReason.Break, targetFrame, yieldedBlockFlowControl.SourceProcKind);
return;
}
else
{
throw new MethodUnwinder(targetFrame, returnValue);
}
}
else
{
throw new LocalJumpError("break from proc-closure");
}
}