summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/YAMLTraits.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-22 00:15:13 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-22 00:15:13 +0000
commit045e4f1365d01ecbb2d2dc8e7132d25cf89a1f03 (patch)
tree4ff5a224c34905cd506ced131f301a7287ae18e6 /llvm/lib/Support/YAMLTraits.cpp
parent7f902715e862666643bbcbc57e7efa4d05082224 (diff)
downloadbcm5719-llvm-045e4f1365d01ecbb2d2dc8e7132d25cf89a1f03.tar.gz
bcm5719-llvm-045e4f1365d01ecbb2d2dc8e7132d25cf89a1f03.zip
Don't call back() on an empty SmallVector. Found by -fsanitize=enum!
llvm-svn: 170968
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
-rw-r--r--llvm/lib/Support/YAMLTraits.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}
OpenPOWER on IntegriCloud