aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Lex/PTHManager.h2
-rw-r--r--lib/Frontend/CacheTokens.cpp2
-rw-r--r--lib/Lex/PTHLexer.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h
index 25a49038a8..44f9ab39f3 100644
--- a/include/clang/Lex/PTHManager.h
+++ b/include/clang/Lex/PTHManager.h
@@ -101,7 +101,7 @@ class PTHManager : public IdentifierInfoLookup {
public:
// The current PTH version.
- enum { Version = 9 };
+ enum { Version = 10 };
~PTHManager();
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp
index 58a6b8d19e..3e666132dc 100644
--- a/lib/Frontend/CacheTokens.cpp
+++ b/lib/Frontend/CacheTokens.cpp
@@ -447,7 +447,7 @@ Offset PTHWriter::EmitCachedSpellings() {
void PTHWriter::GeneratePTH(const std::string &MainFile) {
// Generate the prologue.
- Out << "cfe-pth";
+ Out << "cfe-pth" << '\0';
Emit32(PTHManager::Version);
// Leave 4 words for the prologue.
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index f104f96708..67738e9075 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -452,14 +452,14 @@ PTHManager *PTHManager::Create(const std::string &file,
const unsigned char *BufEnd = (unsigned char*)File->getBufferEnd();
// Check the prologue of the file.
- if ((BufEnd - BufBeg) < (signed)(sizeof("cfe-pth") + 3 + 4) ||
- memcmp(BufBeg, "cfe-pth", sizeof("cfe-pth") - 1) != 0) {
+ if ((BufEnd - BufBeg) < (signed)(sizeof("cfe-pth") + 4 + 4) ||
+ memcmp(BufBeg, "cfe-pth", sizeof("cfe-pth")) != 0) {
Diags.Report(diag::err_invalid_pth_file) << file;
return 0;
}
// Read the PTH version.
- const unsigned char *p = BufBeg + (sizeof("cfe-pth") - 1);
+ const unsigned char *p = BufBeg + (sizeof("cfe-pth"));
unsigned Version = ReadLE32(p);
if (Version < PTHManager::Version) {