Check if a method is dynamic when transforming internal calls (#40266)
authorFan Yang <52458914+fanyang-mono@users.noreply.github.com>
Tue, 4 Aug 2020 02:11:55 +0000 (22:11 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 02:11:55 +0000 (22:11 -0400)
src/mono/mono/mini/interp/transform.c

index 13c9108..1fd13dd 100644 (file)
@@ -1904,7 +1904,7 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
 static MonoMethod*
 interp_transform_internal_calls (MonoMethod *method, MonoMethod *target_method, MonoMethodSignature *csignature, gboolean is_virtual)
 {
-       if (method->wrapper_type == MONO_WRAPPER_NONE && target_method != NULL) {
+       if (((method->wrapper_type == MONO_WRAPPER_NONE) || (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)) && target_method != NULL) {
                if (target_method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
                        target_method = mono_marshal_get_native_wrapper (target_method, FALSE, FALSE);
                if (!is_virtual && target_method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)