Skip to content
Permalink
Browse files

[AssemblyProcessor] Fix a case where ImportReference was not called f…

…or GetTypeFromHandle().
  • Loading branch information
xen2 committed May 24, 2019
1 parent f554045 commit e2c44d3d229bea7e895d20094356ce5c37aa37aa
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
@@ -465,7 +465,7 @@ private static void GenerateSerializerCode(ComplexSerializerRegistry registry)
{
// Generating: System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(<#=type.Value.SerializerType.ConvertCSharp()#>).TypeHandle);
initializeMethodIL.Append(Instruction.Create(OpCodes.Ldtoken, type.Value.SerializerType));
initializeMethodIL.Append(Instruction.Create(OpCodes.Call, getTypeFromHandleMethod));
initializeMethodIL.Append(Instruction.Create(OpCodes.Call, assembly.MainModule.ImportReference(getTypeFromHandleMethod)));
initializeMethodIL.Append(Instruction.Create(OpCodes.Callvirt, getTypeHandleMethodRef));
initializeMethodIL.Append(Instruction.Create(OpCodes.Call, runClassConstructorMethod));
}

0 comments on commit e2c44d3

Please sign in to comment.
You can’t perform that action at this time.