зеркало из https://github.com/microsoft/clang-1.git
fix an inconsistency computing offsets that caused a crash on rewrite-nest.m
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51514 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cfd4c7bef7
Коммит
9ed7cfd351
|
@ -52,7 +52,7 @@ void RewriteBuffer::InsertText(unsigned OrigOffset,
|
|||
/// 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)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// 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
|
||||
|
Загрузка…
Ссылка в новой задаче