/// operation.
void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength,
const char *NewStr, unsigned NewLength) {
- unsigned RealOffset = getMappedOffset(OrigOffset, true);
+ unsigned RealOffset = getMappedOffset(OrigOffset, false);
Buffer.erase(RealOffset, OrigLength);
Buffer.insert(RealOffset, NewStr, NewStr+NewLength);
if (OrigLength != NewLength)
--- /dev/null
+// RUN: clang -rewrite-objc %s -o =-
+
+#include <objc/objc.h>
+
+@interface NSMapTable @end
+@interface NSEnumerator @end
+
+typedef unsigned int NSUInteger;
+
+@interface NSConcreteMapTable : NSMapTable {
+@public
+ NSUInteger capacity;
+}
+@end
+
+@interface NSConcreteMapTableValueEnumerator : NSEnumerator {
+ NSConcreteMapTable *mapTable;
+}
+@end
+
+@implementation NSConcreteMapTableValueEnumerator
+
+- nextObject {
+ while (mapTable->capacity) {
+ }
+ return 0;
+}
+@end
+