]> granicus.if.org Git - clang/commitdiff
Fix a rewriter bug that steve noticed. Don't skip arbitrary things
authorChris Lattner <sabre@nondot.org>
Wed, 14 Nov 2007 22:57:51 +0000 (22:57 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 Nov 2007 22:57:51 +0000 (22:57 +0000)
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

Driver/RewriteTest.cpp

index 92d928cd08ee099cf82b0e1ce7ed93562617ef5e..d953e08581eef8b879bcd26d4da1cc8c5762ada9 100644 (file)
@@ -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")) ||