From: Richard Smith Date: Sat, 22 Dec 2012 00:15:13 +0000 (+0000) Subject: Don't call back() on an empty SmallVector. Found by -fsanitize=enum! X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2b45dd58b22da40bb08e82d1564ccecca4a700f5;p=oota-llvm.git Don't call back() on an empty SmallVector. Found by -fsanitize=enum! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170968 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index a31c31915a1..8fcef40d243 100644 --- a/lib/Support/YAMLTraits.cpp +++ b/lib/Support/YAMLTraits.cpp @@ -516,7 +516,7 @@ void Output::output(StringRef s) { void Output::outputUpToEndOfLine(StringRef s) { this->output(s); - if (StateStack.back() != inFlowSeq) + if (StateStack.empty() || StateStack.back() != inFlowSeq) NeedsNewLine = true; }