-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Hi,
I've found what I think is a "simpler" and more "general" solution for the ExecutionEngineException on events compiled with Visual Studio.
You can simply replace any call to the generic version of CompareExchange:
call !!0 [mscorlib]System.Threading.Interlocked::CompareExchange(!!0&, !!0, !!0)
With a call to the non-generic version:
call object [mscorlib]System.Threading.Interlocked::CompareExchange(object&, object, object)
You can safely do the same for calls to Interlocked::Exchange. You'll maintain thread-safety, and (surprisingly) it works on all platforms (at least for trusted code).
Greatings.