[sre] Register a canonical reflected method for a methodspec token. (Fixes #60233... mono-5.4.1.6
commit1f4613aa1acacbea90a8aa82daeea4a449cf4df7
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Wed, 18 Oct 2017 12:09:39 +0000 (18 08:09 -0400)
committerLudovic Henry <luhenry@microsoft.com>
Wed, 18 Oct 2017 12:09:39 +0000 (18 08:09 -0400)
tree34da703401ecd871331658f5e5468a8e8156ca65
parentd092ad186ffae768279b092bdab513f65af2f7b2
[sre] Register a canonical reflected method for a methodspec token. (Fixes #60233) (#5814)

* [sre] mono_dynamic_image_register_token: Change asserts to warnings

This partly relaxes the changes in 792b5367cd3a6ffa1a192c4d2d7ace3509cbb646
which added the assertions.

In practice the assertions introduced a crash in heavy uses of
System.Reflection.Emit such as unit testing frameworks and dynamic languages.
We still want to know if there are surprising uses of
mono_dynamic_image_register_token, but we don't need a crash.  SRE used to work
before 792b5367cd3a6ffa1a192c4d2d7ace3509cbb646, so no need to break it.

* [test] ILGenerator test for duplicate methodspec tokens

Regression test for [Bugzilla #60233](https://bugzilla.xamarin.com/show_bug.cgi?id=60233)

* [sre] Register a canonical reflected method for a methodspec token (Fixes #60233)

This is like the fix for [bugzilla
59364](https://bugzilla.xamarin.com/show_bug.cgi?id=59364) but this time it's a
methodspec token, not a memberref token.
mcs/class/corlib/Test/System.Reflection.Emit/ILGeneratorTest.cs
mono/metadata/dynamic-image.c
mono/metadata/sre.c