From: Steve Naroff Date: Wed, 6 Aug 2008 15:58:23 +0000 (+0000) Subject: Fix for clang ObjC rewriter: crash rewriting attached file X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aba49d10daaedbc9e8bf6f4c6bfbfa6ea668baa6;p=clang Fix for clang ObjC rewriter: crash rewriting attached file 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 --- diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp index b83200e16e..408860e7e7 100644 --- a/Driver/RewriteObjC.cpp +++ b/Driver/RewriteObjC.cpp @@ -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++; }