[cfe-commits] r123134 - /cfe/trunk/lib/AST/TypePrinter.cpp

Francois Pichet pichet2000 at gmail.com
Sun Jan 9 14:32:25 PST 2011


Author: fpichet
Date: Sun Jan  9 16:32:25 2011
New Revision: 123134

URL: http://llvm.org/viewvc/llvm-project?rev=123134&view=rev
Log:
Don't crash if SpecString is an empty string.

Modified:
    cfe/trunk/lib/AST/TypePrinter.cpp

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=123134&r1=123133&r2=123134&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Sun Jan  9 16:32:25 2011
@@ -870,7 +870,7 @@
   // If the last character of our string is '>', add another space to
   // keep the two '>''s separate tokens. We don't *have* to do this in
   // C++0x, but it's still good hygiene.
-  if (SpecString[SpecString.size() - 1] == '>')
+  if (!SpecString.empty() && SpecString[SpecString.size() - 1] == '>')
     SpecString += ' ';
   
   if (!SkipBrackets)





More information about the cfe-commits mailing list