@@ -76,25 +76,24 @@ public override Task ExecuteAsync()
7676 actualParameter . Name , actualParameter . Attributes ) ;
7777 dummyMethod . ParameterDefinitions . Add ( parameter ) ;
7878 }
79- var dummyMethodBody = dummyMethod . CilMethodBody = new CilMethodBody ( dummyMethod ) ;
79+ var dummyMethodBody = dummyMethod . CilMethodBody = new CilMethodBody ( ) ;
8080 if ( callingMethod . Signature . ReturnsValue )
8181 {
8282 dummyMethodBody . Instructions . Add ( new CilInstruction ( CilOpCodes . Ldnull ) ) ;
8383 }
8484 dummyMethodBody . Instructions . Add ( new CilInstruction ( CilOpCodes . Ret ) ) ;
8585 var signature = MethodSignature . CreateStatic ( systemVoid ) ;
86- var initializationMethod = new MethodDefinition (
87- _renamer . RenameUnsafely ( ) ,
88- MethodAttributes . Assembly | MethodAttributes . Static ,
89- signature ) ;
90- initializationMethod . CilMethodBody = new CilMethodBody ( initializationMethod )
86+ var initializationMethod = new MethodDefinition ( _renamer . RenameUnsafely ( ) , MethodAttributes . Assembly | MethodAttributes . Static , signature )
9187 {
92- Instructions =
88+ CilMethodBody = new CilMethodBody
9389 {
94- new CilInstruction ( CilOpCodes . Ldc_I4 , dummyMethod . MetadataToken . ToInt32 ( ) ) ,
95- new CilInstruction ( CilOpCodes . Ldc_I4 , callingMethodMetadata . MetadataToken . ToInt32 ( ) ) ,
96- new CilInstruction ( CilOpCodes . Call , redirectStubMethod ) ,
97- new CilInstruction ( CilOpCodes . Ret )
90+ Instructions =
91+ {
92+ new CilInstruction ( CilOpCodes . Ldc_I4 , dummyMethod . MetadataToken . ToInt32 ( ) ) ,
93+ new CilInstruction ( CilOpCodes . Ldc_I4 , callingMethodMetadata . MetadataToken . ToInt32 ( ) ) ,
94+ new CilInstruction ( CilOpCodes . Call , redirectStubMethod ) ,
95+ new CilInstruction ( CilOpCodes . Ret )
96+ }
9897 }
9998 } ;
10099 moduleType . Methods . Add ( initializationMethod ) ;
0 commit comments