ILVerify fails to verify some catch-to-try leave instructions
#48.250 geöffnet am 12. Feb. 2021
Repository-Metriken
- Stars
- (17.886 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)
Beschreibung
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