[cfe-commits] r48541 - /cfe/trunk/include/clang/Rewrite/Rewriter.h

Ted Kremenek kremenek at apple.com
Wed Mar 19 01:00:50 PDT 2008


Author: kremenek
Date: Wed Mar 19 03:00:50 2008
New Revision: 48541

URL: http://llvm.org/viewvc/llvm-project?rev=48541&view=rev
Log:
Integrated some of Chris's comments; check for an empty string in InsertStrXXX()
before descending into the bowels of the Rewriter.

Modified:
    cfe/trunk/include/clang/Rewrite/Rewriter.h

Modified: cfe/trunk/include/clang/Rewrite/Rewriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/Rewriter.h?rev=48541&r1=48540&r2=48541&view=diff

==============================================================================
--- cfe/trunk/include/clang/Rewrite/Rewriter.h (original)
+++ cfe/trunk/include/clang/Rewrite/Rewriter.h Wed Mar 19 03:00:50 2008
@@ -184,11 +184,11 @@
   }
   
   bool InsertStrBefore(SourceLocation Loc, const std::string& S) {
-    return InsertTextBefore(Loc, S.c_str(), S.size());
+    return S.empty() ? false : InsertTextBefore(Loc, S.c_str(), S.size());
   }
 
   bool InsertStrAfter(SourceLocation Loc, const std::string& S) {
-    return InsertTextAfter(Loc, S.c_str(), S.size());
+    return S.empty() ? false : InsertTextAfter(Loc, S.c_str(), S.size());
   }
   
   





More information about the cfe-commits mailing list