DependencyAutoProperty mutator generates invalid IL


There are three errors in the IL generated by the DependencyAutoProperty mutator.
In the static constructor it may generate:
1) Constructors must have their return type set to void.
2) Verifiable code must have initlocals set on the method body.
In the rewritten property setters:
3) Value types must be boxed before passing them as objects
I believe the attached patch fixes all these errors.

file attachments


ckitching wrote May 27, 2010 at 4:50 AM

WeakLazyPropertyMutator also has some similar errors.

[IL]: Error: [CciSharp.Test.exe : CciSharp.Test.WeakLazyAutoPropertyTest+Foo::get_Value][offset 0x0000001C] initlocals must be set for verifiable methods with one or more local variables.
[IL]: Error: [CciSharp.Test.exe : CciSharp.Test.WeakLazyAutoPropertyTest+Foo::get_Value][offset 0x00000011] The 'this' parameter to the call must be the calling method's 'this' parameter.