dotnet/runtime

ILVerify fails to verify some catch-to-try leave instructions

Open

#48,250 建立於 2021年2月12日

在 GitHub 查看
 (2 留言) (0 反應) (1 負責人)C# (5,445 fork)batch import
Priority:3area-Tools-ILVerificationhelp wanted

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

Description

To reproduce: Run ILVerify on the Foo.dll assembly in this zip file. The following output should be produced:

[IL]: Error [LeaveIntoTry]: [...\Foo.dll : .A::m2(int32)][offset 0x00000014] Leave into try block.
1 Error(s) Verifying ...\Foo.dll

If the assembly is executed on .NET 5 (by invoking its Main method), it produces the expected output without any errors.

The assembly contains two static methods A.m1 and A.m2. Both contain leave instructions that jump from a catch block to its associated try block, which is legal according to ECMA-335, section I.12.4.2.8.2.8.

ILVerify correctly verifies the leave in A.m1. In A.m2, the catch block and the try block to which it jumps to are nested in another try block which has a finally block, which triggers the bug.

Configuration

ILVerify version: 5.0.0-rtm.20519.4+cf258a14b70ad9069470a108f13765e0e5988f51

貢獻者指南