Skip to content

Commit 7ddade2

Browse files
authored
Merge pull request #1041 from Unity-Technologies/unity-master-bug-1073634
Use empty array for wrapper methods (case 1073634)
2 parents 04ae5cc + 79a5689 commit 7ddade2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mono/metadata/reflection.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,15 @@ 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) */
1092+
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;
1097+
}
1098+
10901099
/* Note: the cache is based on the address of the signature into the method
10911100
* since we already cache MethodInfos with the method as keys.
10921101
*/

0 commit comments

Comments
 (0)