[marshal] Don't use a wrapper for mono_marshal_set_last_error
authorAleksey Kliger <aleksey@xamarin.com>
Mon, 28 Aug 2017 18:21:36 +0000 (14:21 -0400)
committerAleksey Kliger (λgeek) <akliger@gmail.com>
Thu, 31 Aug 2017 14:42:19 +0000 (10:42 -0400)
commit0270871238b17f7f3c4b319352c0aa2078f6b9ab
tree329b35a5496ba7153b1c42fc526957ea4d8bf78b
parenta7f706251bf96a3e667a13b8575f104e7faf6951
[marshal] Don't use a wrapper for mono_marshal_set_last_error

This fixes assertions due to d0e103fcb4ed3f0ba867052f9b5a4ac71faa0226 in
cooperative GC mode.

mono_marshal_set_last_error is called from a P/Invoke wrapper just after the
pinvoked method returns before we transition the thread state back to running
from blocking.  If mono_marshal_set_last_error had a wrapper, we would invoke
the trampoline (mono_magic_trampoline) to JIT the wrapper while in blocking
mode, which would trigger the assertion.
mono/metadata/marshal.c