Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate diagnosable failfast in GVM resolution (#78936)
If the program hits the conditions in #77070, generate a failfast message that makes it possible to create a workaround. Instead of: ``` Process terminated. Generic virtual method pointer lookup failure. Declaring type handle: MethodTable:0x00007FF66E8587B8 Target type handle: MethodTable:0x00007FF66E858810 Method name: Serialize Instantiation: Argument 00000000: MethodTable:0x00007FF66E85DA08 ``` Generate: ``` Process terminated. Generic virtual method pointer lookup failure. Declaring type handle: EETypeRva:0x005438B8(MemoryPackFormatter2`1[MemPackObject]) Target type handle: EETypeRva:0x00543910(MemoryPackableFormatter2`1[MemPackObject]) Method name: Serialize Instantiation: Argument 00000000: EETypeRva:0x00529B38(System.Buffers.ArrayBufferWriter`1[System.Byte]) ``` The workaround is then: ```xml <Directives> <Application> <Assembly Name="repro"> <Type Name="MemoryPackableFormatter2`1[[MemPackObject]]"> <Method Name="Serialize" Dynamic="Required All"> <GenericArgument Name="System.Buffers.ArrayBufferWriter`1[[System.Byte, mscorlib]],System.Memory" /> </Method> </Type> </Assembly> </Application> </Directives> ``` Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
- Loading branch information