[linker] do not try to iterate thru null array
authorRadek Doulik <rodo@xamarin.com>
Thu, 12 Nov 2015 19:57:40 +0000 (20:57 +0100)
committerRadek Doulik <rodo@xamarin.com>
Thu, 12 Nov 2015 20:07:19 +0000 (21:07 +0100)
 - fixes the case when custom attribute instance constructor contains
   null value for System.Type[] array

mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs

index bd55c8527c6d154f2b16908a6a7d4c3144eb83d9..74c219a82b61bd5811c3b708350b6a85a7c19a92 100644 (file)
@@ -336,6 +336,9 @@ namespace Mono.Linker.Steps {
                                        return;
 
                                MarkType (et);
+                               if (argument.Value == null)
+                                       return;
+
                                foreach (var cac in (CustomAttributeArgument[]) argument.Value)
                                        MarkWithResolvedScope ((TypeReference) cac.Value);
                        } else if (at.Namespace == "System" && at.Name == "Type") {