• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
objc_msgSend problems on x86
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

objc_msgSend problems on x86


  • Subject: objc_msgSend problems on x86
  • From: Rosyna <email@hidden>
  • Date: Thu, 9 Feb 2006 03:25:29 -0700

I've noticed when running code like:

bool isEqual=objc_msgSend(string, NSSelectorFromString(CFSTR("isEqualToString:")), otherString);

On the PPC will work just fine 100% of the time. If I run the same code on the ICBMs it'll return true even when the strings weren't equal at all in some rare cases. It also shows an error in GCC

Even worse was trying something like:

if (objc_msgSend(string, NSSelectorFromString(CFSTR("isEqualToString:")), otherString))

which returns true the far majority of the time even when it the strings are not equal. However, if I change the code to read:

if ((signed char(*)(id, SEL, id)objc_msgSend)(string, NSSelectorFromString(CFSTR("isEqualToString:")), otherString))

it always returns the correct value. Is there a reason for this change between the PPC and the x86?
--



Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: objc_msgSend problems on x86
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Re: Core Data Problem
  • Next by Date: Update the scroller in a NSScrollView from its documentView ?
  • Previous by thread: Re: Using Zlib for i386 code
  • Next by thread: Re: objc_msgSend problems on x86
  • Index(es):
    • Date
    • Thread