[linker] Do not process custom attribute fields unless there are some (avoids memory...
authorSebastien Pouliot <sebastien@xamarin.com>
Thu, 5 Feb 2015 20:18:47 +0000 (15:18 -0500)
committerSebastien Pouliot <sebastien@xamarin.com>
Thu, 5 Feb 2015 20:18:47 +0000 (15:18 -0500)
mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs

index 03c07bed4e18dd559967eac8f888f763b34c61ac..b4680fb2de5a1077153aaa917dc986c6b793ef23 100644 (file)
@@ -141,6 +141,9 @@ namespace Mono.Tuner {
 
                        Annotations.Mark (type);
 
+                       if (!attribute.HasFields)
+                               return;
+
                        foreach (var named_argument in attribute.Fields)
                                if (named_argument.Name == "AllMembers" && (bool) named_argument.Argument.Value)
                                        Annotations.SetPreserve (type, TypePreserve.All);