Fix generic struct delegate in ReadyToRun (#3690)
authorJohn Chen (JOCHEN7) <jochen@microsoft.com>
Wed, 23 Mar 2016 22:05:11 +0000 (15:05 -0700)
committerJohn Chen (JOCHEN7) <jochen@microsoft.com>
Thu, 24 Mar 2016 02:27:42 +0000 (19:27 -0700)
commit70aee6c7c67744508dc9f855cf340967bcdf7809
treedd1714b03a17a69d7737f65c05609401c02b213a
parent3a90116acc529aaf89d1ebf466259d5b47063fba
Fix generic struct delegate in ReadyToRun (#3690)

The following code pattern triggers a crash when compiled into Ready To Run:

    struct S<T>
    {
        public void M() { ... }
    }

    class C { }

    Then create a delegate using S<C>.M

The cause of the crash is calling S<C>.M normally reaches a shared generic
method S<__Canon>.M, but for delegate creation we need to use the actual
S<C>.M. Ready To Run generated code that attempts to create delegate using
S<__Canon>.M, which is not allowed.
src/vm/prestub.cpp