aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-14 22:57:51 +0000
committerChris Lattner <sabre@nondot.org>2007-11-14 22:57:51 +0000
commitdf6a51b0202d10963ed005c2480e3b4a10d16928 (patch)
treecacb57cca4a23ab8df9754346920ad273ef2bbb7 /Driver/RewriteTest.cpp
parent21d50e12c3c412d8457071dc419363b7a7e8b855 (diff)
Fix a rewriter bug that steve noticed. Don't skip arbitrary things
between an @ and a p, just skip whitespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 92d928cd08..d953e08581 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1178,7 +1178,10 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
while (cursor < endBuf) {
if (*cursor == '@') {
SourceLocation atLoc = LocStart.getFileLocWithOffset(cursor-startBuf);
- cursor = strchr(cursor, 'p');
+ // Skip whitespace.
+ for (++cursor; cursor[0] == ' ' || cursor[0] == '\t'; ++cursor)
+ /*scan*/;
+
// FIXME: presence of @public, etc. inside comment results in
// this transformation as well, which is still correct c-code.
if (!strncmp(cursor, "public", strlen("public")) ||