Priority:3area-Tools-ILVerificationhelp wanted
Repository metrics
- Stars
- (17,886 stars)
- PR merge metrics
- (Avg merge 12d 11h) (661 merged PRs in 30d)
Description
Today when ILVerify found issue we report tokens/offsets value for type system item for IL methods i.e.
[IL]: Error: [C:\git\corert\bin\Windows_NT.x64.Debug\ILVerification.Tests\Tests\BranchingTests.dll : BranchingTestsType::Branching.FromTryIntoFinally_Invalid_BranchOutOfTry.BranchIntoHandler()][offset 0x00000004] Branch out of try block.
We added some new type check and we decided to not report token value for it because they are not useful for regular use i.e.
[MD]: Error: Interface implementation has a duplicate. Class '[InterfaceImplementation]InterfaceImplHasDuplicate_InvalidType_InterfaceImplHasDuplicate' Interface: '[InterfaceDefinition]Interface'
However there are some scenario where tokens are useful, for instance on obfuscated code. We should refactor code to have token values only if a user pass '--tokens' switch to command line. Reference https://github.com/dotnet/corert/pull/6687#discussion_r241916514
Task list:
- Add
--tokensoption to command line https://github.com/dotnet/corert/pull/6730 - Include metadata tokens in error messages for new type verifier https://github.com/dotnet/corert/blob/master/src/ILVerification/src/TypeVerifier.cs#L112
- Move IL verifier error message from driver to IL importer and include metadata token only if
--tokensis passed
Extra: cleanup code https://github.com/dotnet/corert/pull/6758#discussion_r248405930