Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp
index d88e57d..e79453c 100644
--- a/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -68,7 +68,7 @@
// Make sure we have enough space in the spelling buffer.
if (I->getLength() < SpellingBuffer.size())
SpellingBuffer.resize(I->getLength());
- const char *Buffer = &SpellingBuffer[0];
+ const char *Buffer = SpellingBuffer.data();
unsigned SpellingLen = PP.getSpelling(*I, Buffer);
OS.write(Buffer, SpellingLen);
}