From cf0acbb1fa7f9988d93a8944d7049d7c5d273bfc Mon Sep 17 00:00:00 2001 From: jbevain Date: Fri, 8 Jan 2010 13:59:20 +0000 Subject: [PATCH] 2010-01-08 Jb Evain * Expression.cs (Call): properly deal with zero length array of type arguments for non generic methods. Fixes #568989. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@149240 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System.Core/System.Linq.Expressions/ChangeLog | 5 +++++ class/System.Core/System.Linq.Expressions/Expression.cs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/class/System.Core/System.Linq.Expressions/ChangeLog b/class/System.Core/System.Linq.Expressions/ChangeLog index cc36c0253b..8c1d3dd217 100644 --- a/class/System.Core/System.Linq.Expressions/ChangeLog +++ b/class/System.Core/System.Linq.Expressions/ChangeLog @@ -1,3 +1,8 @@ +2010-01-08 Jb Evain + + * Expression.cs (Call): properly deal with zero length array + of type arguments for non generic methods. Fixes #568989. + 2009-12-02 Gonzalo Paniagua Javier * Expression.cs: expression can be null for static getters. Patch from diff --git a/class/System.Core/System.Linq.Expressions/Expression.cs b/class/System.Core/System.Linq.Expressions/Expression.cs index 78ed9ead2e..b87a634af8 100644 --- a/class/System.Core/System.Linq.Expressions/Expression.cs +++ b/class/System.Core/System.Linq.Expressions/Expression.cs @@ -1043,7 +1043,7 @@ namespace System.Linq.Expressions { if (method == null) return null; - if (!method.IsGenericMethod && args == null) + if (!method.IsGenericMethod && (args == null || args.Length == 0)) return method; if (args.Length == method.GetGenericArguments ().Length) @@ -2097,7 +2097,7 @@ namespace System.Linq.Expressions { throw new ArgumentNullException ("expression"); if (!expression.Type.IsAssignableTo (propertyAccessor.DeclaringType)) throw new ArgumentException ("expression"); - } + } // // .NET does not mandate that if the property is static, that the expression must be null // fixes a bug exposed by Orchard's ContentItemRecordAlteration.Alteration -- 2.11.4.GIT