mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix logic error in GSPrivateRangeOfString.
We were checking if the receiver was a specific class, then directly accessing an ivar of target. We were then checking if target is a specific class and, if so, accessing the ivar or target. This mostly worked because most GNUstep strings have the same underlying implementation and so the check was passing and by coincidence giving the correct value. This breaks when GSTinyStrings are used more often and was picked up by teaching the compiler to generate GSTinyStrings for small string literals.
This commit is contained in:
parent
ced3b27144
commit
0ebb50f984
1 changed files with 1 additions and 1 deletions
|
@ -3523,7 +3523,7 @@ GSPrivateRangeOfString(NSString *receiver, NSString *target)
|
|||
return (GSRSFunc)strRangeUsNs;
|
||||
}
|
||||
else if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)target)->_flags.wide == 0))
|
||||
|| (c == GSMutableStringClass && ((GSStr)receiver)->_flags.wide == 0))
|
||||
{
|
||||
c = object_getClass(target);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|
|
Loading…
Reference in a new issue