Skip to content

Commit fde6b4d

Browse files
committed
Use wrapped method if available (case 1093274)
Reverts part of fix for case 1073634
1 parent b04ac91 commit fde6b4d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mono/metadata/reflection.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,14 @@ mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoCla
10871087
return res;
10881088
}
10891089

1090-
/* UNITY: wrapper methods are being captured in callstacks, even thought users should not encounter them.
1091-
* The logic in param_objects_construct cannot handle this. Just return empty array (case 1073634) */
1090+
/* Wrapper methods are exposed in stack traces.
1091+
* The logic in param_objects_construct cannot handle some wrappers.
1092+
* Get the underlying method if it's available.
1093+
*/
10921094
if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) {
1093-
MonoArrayHandle res = mono_array_new_handle (domain, mono_class_get_mono_parameter_info_class (), 0, error);
1094-
goto_if_nok (error, fail);
1095-
1096-
return res;
1095+
MonoMethod* wrapped_method = mono_marshal_method_from_wrapper (method);
1096+
if (wrapped_method)
1097+
method = wrapped_method;
10971098
}
10981099

10991100
/* Note: the cache is based on the address of the signature into the method

0 commit comments

Comments
 (0)