-[NSMutableIndexSet shiftIndexesStartingAtIndex:by:] produces invalid results
| Originator: | christian | ||
| Number: | rdar://14707836 | Date Originated: | 11-Aug-2013 02:53 PM |
| Status: | Open | Resolved: | |
| Product: | OSX, iOS | Product Version: | 10.8,7.0 |
| Classification: | Serious Bug | Reproducible: | Always |
11-Aug-2013 02:53 PM Christian Niles:
Summary:
-[NSMutableIndexSet shiftIndexesStartingAtIndex:by:] is supposed to shift indexes in the set by a specified amount. I've discovered that the results are incorrect when delta is negative and (startIndex + delta) exists in the set.
The problem exists both on OS X and iOS.
Steps to Reproduce:
Invoke -[NSMutableIndexSet shiftIndexesStartingAtIndex:5 by:-1] on an index set like {0,4,8,12,16,20}.
Expected Results:
I'd expect the index set to be {0,4,7,11,15,19}
Actual Results:
The index set is {0,7,11,15,19}
Regression:
Notes:
A workaround is to always ensure that the method is provided an index that exists in the set. However, sample code that I've attached shows that the method works with many other inputs, so I believe this is a bug.
11-Aug-2013 02:53 PM Christian Niles:
'MutableIndexSetShiftBug.zip' was successfully uploaded
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!