From c73c3feaee6f30755fe264fe3961cc001299be84 Mon Sep 17 00:00:00 2001 From: zoltan Date: Sat, 20 Jun 2009 20:47:29 +0000 Subject: [PATCH] 2009-06-20 Zoltan Varga * IntPtr.cs (.ctor): Allow long values whose 31th bit is set. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@136550 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/corlib/System/ChangeLog | 4 ++++ class/corlib/System/IntPtr.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/class/corlib/System/ChangeLog b/class/corlib/System/ChangeLog index d7431e7228..10a2ea2612 100644 --- a/class/corlib/System/ChangeLog +++ b/class/corlib/System/ChangeLog @@ -1,3 +1,7 @@ +2009-06-20 Zoltan Varga + + * IntPtr.cs (.ctor): Allow long values whose 31th bit is set. + 2009-06-18 Gonzalo Paniagua Javier * DateTime.cs: quick fix for the 1.x build. diff --git a/class/corlib/System/IntPtr.cs b/class/corlib/System/IntPtr.cs index ada701d961..5c148f6c34 100644 --- a/class/corlib/System/IntPtr.cs +++ b/class/corlib/System/IntPtr.cs @@ -74,7 +74,7 @@ namespace System #endif public IntPtr (long value) { - if (((value > Int32.MaxValue) || (value < Int32.MinValue)) && (IntPtr.Size < 8)) { + if (((value >> 32 > 0) || (value < 0)) && (IntPtr.Size < 8)) { throw new OverflowException ( Locale.GetText ("This isn't a 64bits machine.")); } -- 2.11.4.GIT