本文整理汇总了C#中Mono.CSharp.EmitContext.EndExceptionBlock方法的典型用法代码示例。如果您正苦于以下问题:C# EmitContext.EndExceptionBlock方法的具体用法?C# EmitContext.EndExceptionBlock怎么用?C# EmitContext.EndExceptionBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.EmitContext
的用法示例。
在下文中一共展示了EmitContext.EndExceptionBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitForDispose
public override void EmitForDispose (EmitContext ec, Iterator iterator, Label end, bool have_dispatcher)
{
if (emitted_dispose)
return;
emitted_dispose = true;
Label end_of_try = ec.DefineLabel ();
// Ensure that the only way we can get into this code is through a dispatcher
if (have_dispatcher)
ec.Emit (OpCodes.Br, end);
ec.BeginExceptionBlock ();
ec.MarkLabel (dispose_try_block);
Label [] labels = null;
for (int i = 0; i < resume_points.Count; ++i) {
ResumableStatement s = (ResumableStatement) resume_points [i];
Label ret = s.PrepareForDispose (ec, end_of_try);
if (ret.Equals (end_of_try) && labels == null)
continue;
if (labels == null) {
labels = new Label [resume_points.Count];
for (int j = 0; j < i; ++j)
labels [j] = end_of_try;
}
labels [i] = ret;
}
if (labels != null) {
int j;
for (j = 1; j < labels.Length; ++j)
if (!labels [0].Equals (labels [j]))
break;
bool emit_dispatcher = j < labels.Length;
if (emit_dispatcher) {
//SymbolWriter.StartIteratorDispatcher (ec.ig);
ec.Emit (OpCodes.Ldloc, iterator.CurrentPC);
ec.EmitInt (first_resume_pc);
ec.Emit (OpCodes.Sub);
ec.Emit (OpCodes.Switch, labels);
//SymbolWriter.EndIteratorDispatcher (ec.ig);
}
foreach (ResumableStatement s in resume_points)
s.EmitForDispose (ec, iterator, end_of_try, emit_dispatcher);
}
ec.MarkLabel (end_of_try);
ec.BeginFinallyBlock ();
EmitFinallyBody (ec);
ec.EndExceptionBlock ();
}
示例2: DoEmit
protected override void DoEmit (EmitContext ec)
{
if (!inside_try_finally)
ec.BeginExceptionBlock ();
Block.Emit (ec);
foreach (Catch c in Specific)
c.Emit (ec);
if (General != null)
General.Emit (ec);
if (!inside_try_finally)
ec.EndExceptionBlock ();
}