OpCodes.Endfilter 字段
定义
将控制从异常的 filter 子句转移回公共语言结构 (CLI) 异常处理程序。Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler.
public: static initonly System::Reflection::Emit::OpCode Endfilter;
public static readonly System.Reflection.Emit.OpCode Endfilter;
staticval mutable Endfilter : System.Reflection.Emit.OpCode
Public Shared ReadOnly Endfilter As OpCode
字段值
注解
下表列出了指令的十六进制和 Microsoft 中间语言 (MSIL) 程序集格式,以及简短的参考摘要:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:
| 格式Format | 程序集格式Assembly Format | 说明Description |
|---|---|---|
| FE 11FE 11 | 执行 endfilterendfilter | SEH 异常处理的结束筛选器子句。End filter clause of SEH exception handling. |
堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:
value被推送到堆栈上。valueis pushed onto the stack.value从堆栈中弹出;endfilter执行,并将控制权传输到异常处理程序。valueis popped from the stack;endfilteris executed and control is transferred to the exception handler.
Value (的类型必须是 int32 ,并且是从 filter 子句返回) 的一组特定值。Value (which must be of type int32 and is one of a specific set of values) is returned from the filter clause. 它应该是以下其中之一:It should be one of:
exception_continue_search(value= 0) 继续搜索异常处理程序exception_continue_search(value= 0) to continue searching for an exception handlerexception_execute_handler(value= 1) 启动异常处理的第二个阶段,其中 finally 块将一直运行,直到找到与此筛选器子句关联的处理程序。exception_execute_handler(value= 1) to start the second phase of exception handling where finally blocks are run until the handler associated with this filter clause is located. 发现后,将执行处理程序。Upon discovery, the handler is executed.
其他整数值将产生未指定的结果。Other integer values will produce unspecified results.
筛选器的入口点(如方法的异常表中所示)必须是筛选器的代码块中的第一个指令。The entry point of a filter, as shown in the method's exception table, must be the first instruction in the filter's code block. endfilter指令必须是筛选器的代码块中的最后一个指令 (因此,只有一个筛选器 endfilter 块) 。The endfilter instruction must be the last instruction in the filter's code block (hence there can only be one endfilter for any single filter block). 执行指令后 endfilter ,控件以逻辑方式流回 CLI 异常处理机制。After executing the endfilter instruction, control logically flows back to the CLI exception handling mechanism.
不能将控件传输到筛选器块中,除非通过异常机制。Control cannot be transferred into a filter block except through the exception mechanism. 除了通过使用 throw 指令或通过执行最后一个指令以外,不能从筛选器块中转移控件 endfilter 。Control cannot be transferred out of a filter block except through the use of a throw instruction or by executing the final endfilter instruction. 不能将 try 块嵌入到 filter 块中。You cannot embed a try block within a filter block. 如果在块内引发异常,则将 filter 被截获并返回值 0 (exception_continue_search) 。If an exception is thrown inside the filter block, it is intercepted and a value of 0 (exception_continue_search) is returned.
以下 Emit 方法重载可以使用 endfilter 操作码:The following Emit method overload can use the endfilter opcode: