[llvm-commits] [llvm] r170968 - /llvm/trunk/lib/Support/YAMLTraits.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Fri Dec 21 16:15:13 PST 2012
Author: rsmith
Date: Fri Dec 21 18:15:13 2012
New Revision: 170968
URL: http://llvm.org/viewvc/llvm-project?rev=170968&view=rev
Log:
Don't call back() on an empty SmallVector. Found by -fsanitize=enum!
Modified:
llvm/trunk/lib/Support/YAMLTraits.cpp
Modified: llvm/trunk/lib/Support/YAMLTraits.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLTraits.cpp?rev=170968&r1=170967&r2=170968&view=diff
==============================================================================
--- llvm/trunk/lib/Support/YAMLTraits.cpp (original)
+++ llvm/trunk/lib/Support/YAMLTraits.cpp Fri Dec 21 18:15:13 2012
@@ -516,7 +516,7 @@
void Output::outputUpToEndOfLine(StringRef s) {
this->output(s);
- if (StateStack.back() != inFlowSeq)
+ if (StateStack.empty() || StateStack.back() != inFlowSeq)
NeedsNewLine = true;
}
More information about the llvm-commits
mailing list