]> granicus.if.org Git - clang/commitdiff
Fix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting attached file
authorSteve Naroff <snaroff@apple.com>
Wed, 6 Aug 2008 15:58:23 +0000 (15:58 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 6 Aug 2008 15:58:23 +0000 (15:58 +0000)
While this is a safe rewriter fix, there is still a need for some discussion (see report for more info).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54412 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index b83200e16ec15f2be4d37258d785524e10b7fb75..408860e7e7b754f1e4748a05dfc16e277d35b398 100644 (file)
@@ -1692,7 +1692,9 @@ void RewriteObjC::RewriteObjCQualifiedInterfaceTypes(Decl *Dcl) {
       startBuf = ++endBuf;
     }
     else {
-      while (*startBuf != ')' && *startBuf != ',')
+      // If the function name is derived from a macro expansion, then the
+      // argument buffer will not follow the name. Need to speak with Chris.
+      while (*startBuf && *startBuf != ')' && *startBuf != ',')
         startBuf++; // scan forward (from the decl location) for argument types.
       startBuf++;
     }