From 045e4f1365d01ecbb2d2dc8e7132d25cf89a1f03 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 22 Dec 2012 00:15:13 +0000 Subject: Don't call back() on an empty SmallVector. Found by -fsanitize=enum! llvm-svn: 170968 --- llvm/lib/Support/YAMLTraits.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support') diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index a31c31915a1..8fcef40d243 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/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; } -- cgit v1.2.3