From: Francois Pichet Date: Sun, 9 Jan 2011 22:32:25 +0000 (+0000) Subject: Don't crash if SpecString is an empty string. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5bc7d04447026252b5181537ab4edcfdbeb3587;p=clang Don't crash if SpecString is an empty string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123134 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index 777835640d..ef9704ec85 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -870,7 +870,7 @@ TemplateSpecializationType::PrintTemplateArgumentList( // 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)