gnustep-dev
[Top][All Lists]
Advanced

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

Re: Fix NSConnection bug on 64 bits archs


From: Eric Wasylishen
Subject: Re: Fix NSConnection bug on 64 bits archs
Date: Mon, 5 Mar 2012 20:16:18 -0700

Thanks, I fixed this and several other instances in base where
NSNotFound was read from or stored in an unsigned or int variable.

(I didn't change the "c" variable here to NSUInteger because I don't
think it's strictly necessary - a lot of NSConnection code uses
"unsigned" - but it could be a good idea)

Eric

On Mon, Mar 5, 2012 at 8:57 AM, Philippe Roussel <address@hidden> wrote:
> 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
>
> _______________________________________________
> Gnustep-dev mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/gnustep-dev



reply via email to

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