From aba49d10daaedbc9e8bf6f4c6bfbfa6ea668baa6 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54412 91177308-0d34-0410-b5e6-96231b3b80d8 --- Driver/RewriteObjC.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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++; } -- 2.50.1