Skip to content

Commit 0854d9b

Browse files
committed
Make ProperInfo.GetValue AOt-friendly
On AOT platforms, the GetValue method won't work with the normal implementation. To make this work, fall back to the slower AOT-friendly implementation. Once we have AOT platforms using only the unityaot profile in Unity, we will make this change only for AOT platforms. For now though, let's fix it everywhere. These changes correct case 1030427 in Unity.
1 parent dc55175 commit 0854d9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mcs/class/corlib/System.Reflection/MonoProperty.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ public override object GetValue (object obj, object[] index)
378378
{
379379
if (index == null || index.Length == 0) {
380380
/*FIXME we should check if the number of arguments matches the expected one, otherwise the error message will be pretty criptic.*/
381-
#if !FULL_AOT_RUNTIME
381+
// Once we ship the changes to make il2cpp always use the unityaot profile, we should change
382+
// this define to be UNITY_AOT. for now though, we'll take the AOT-friendly code path in all profiles.
383+
#if !FULL_AOT_RUNTIME && !UNITY
382384
if (cached_getter == null) {
383385
MethodInfo method = GetGetMethod (true);
384386
if (!DeclaringType.IsValueType && !method.ContainsGenericParameters) { //FIXME find a way to build an invoke delegate for value types.

0 commit comments

Comments
 (0)