gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix NSConnection bug on 64 bits archs


From: Philippe Roussel
Subject: Fix NSConnection bug on 64 bits archs
Date: Mon, 05 Mar 2012 16:57:43 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Hi,

Lucas Schnorr ran into the following problem (I can reproduce it too) :

2012-03-05 10:08:26.409 tobjc[6709] Problem posting notification:
<NSException: 0x7f22d8005658> NAME:NSRangeException REASON:Index -1 is
out of range 1 (in 'objectAtIndex:') INFO:{Array = ("<NSRunLoop:
0x1cfe998>"); Count = 1; Index = 4294967295; }

NSConnection was probably forgotten when NSArray was moved to NSUInteger. I think the following patch is needed :

Index: Source/NSConnection.m
===================================================================
--- Source/NSConnection.m       (révision 34875)
+++ Source/NSConnection.m       (copie de travail)
@@ -1583,11 +1583,11 @@
   GS_M_LOCK(IrefGate);
   if (IrunLoops != nil)
     {
-      unsigned pos = [IrunLoops indexOfObjectIdenticalTo: loop];
+      NSUInteger pos = [IrunLoops indexOfObjectIdenticalTo: loop];

       if (pos != NSNotFound)
        {
-         unsigned      c = [IrequestModes count];
+         NSUInteger c = [IrequestModes count];

          while (c-- > 0)
            {

Philippe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]