From c884aa8e849e0d5e95b72e74bd1bc9888e7d301b Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 6 Aug 2008 15:58:23 +0000 Subject: [PATCH] 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). llvm-svn: 54412 --- clang/Driver/RewriteObjC.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/Driver/RewriteObjC.cpp b/clang/Driver/RewriteObjC.cpp index b83200e16ec1..408860e7e7b7 100644 --- a/clang/Driver/RewriteObjC.cpp +++ b/clang/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++; }