diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-22 00:15:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-22 00:15:13 +0000 |
commit | 2b45dd58b22da40bb08e82d1564ccecca4a700f5 (patch) | |
tree | 49da29c5119a53bed099ef7e76cdaf121fbcbc8b /lib/Support | |
parent | d0696ef8c33b9b2504e89bc0aab2ea99a6c90756 (diff) | |
download | external_llvm-2b45dd58b22da40bb08e82d1564ccecca4a700f5.zip external_llvm-2b45dd58b22da40bb08e82d1564ccecca4a700f5.tar.gz external_llvm-2b45dd58b22da40bb08e82d1564ccecca4a700f5.tar.bz2 |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/YAMLTraits.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index a31c319..8fcef40 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; } |