Skip to content

Dev15 is producing unverifiable IL #1749

@jaredpar

Description

@jaredpar

Repo steps:

  1. Clone https://github.com/jaredpar/VsVim
  2. Open in Dev15 Preview 5 or above. It will likely ask to upgrade the solution. Allow it to do so, it won't affect the repo
  3. Build
  4. Run peverify on Src\VimCore\bin\Debug\Vim.Core.dll

The tool will emit the following verification errors:

[IL]: Error: [c:\Users\jaredpar\code\VsVim\Src\VimCore\bin\Debug\Vim.Core.dll : <StartupCode$Vim-Core>.$StatusUtil+GetStatusUtilForBuffer@50::Invoke][offset 0x00000000] Unrecognized argument number.
[IL]: Error: [c:\Users\jaredpar\code\VsVim\Src\VimCore\bin\Debug\Vim.Core.dll : <StartupCode$Vim-Core>.$StatusUtil+GetStatusUtilForView@54::Invoke][offset 0x00000000] Unrecognized argument number.
[IL]: Error: [c:\Users\jaredpar\code\VsVim\Src\VimCore\bin\Debug\Vim.Core.dll : <StartupCode$Vim-Core>.$FoldManager+GetFoldData@243::Invoke][offset 0x00000000] Unrecognized argument number.
[IL]: Error: [c:\Users\jaredpar\code\VsVim\Src\VimCore\bin\Debug\Vim.Core.dll : <StartupCode$Vim-Core>.$FoldManager+GetFoldManager@246::Invoke][offset 0x00000000] Unrecognized argument number.
4 Error(s) Verifying Vim.Core.dll

That corresponds to the following F# code

    /// Get or create an PropagatingStatusUtil instance for the ITextBuffer
    member x.GetStatusUtilForBuffer (textBuffer : ITextBuffer) =
        textBuffer.Properties.GetOrCreateSingletonProperty(_key, (fun _ -> PropagatingStatusUtil()))

    /// Get or create an StatusUtil instance for the ITextView
    member x.GetStatusUtilForView (textView : ITextView) =
        textView.Properties.GetOrCreateSingletonProperty(_key, (fun _ -> StatusUtil()))

    member x.GetFoldData (textBuffer : ITextBuffer) = 
        textBuffer.Properties.GetOrCreateSingletonProperty(_dataKey, (fun _ -> FoldData(textBuffer)))

It looks like that particular pattern is causing issues with the compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions