r251828 - [PTH] Fix data length used for stat cache entries

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 12:47:31 PST 2015


Author: rnk
Date: Mon Nov  2 14:47:31 2015
New Revision: 251828

URL: http://llvm.org/viewvc/llvm-project?rev=251828&view=rev
Log:
[PTH] Fix data length used for stat cache entries

This came up in a boost build, which apparently uses PTH. This was
broken in r187619 when we migrated it to uses llvm::fs instead of raw
stat calls.

Constructing a test case with a hash table collision in-tree is tough.
Instead, I have a pending change to OnDiskChainedHashTable that asserts
that the reported length of the data agrees with the data actually
written. All of the existing in-tree tests find the bug with this
assert.

Modified:
    cfe/trunk/lib/Frontend/CacheTokens.cpp

Modified: cfe/trunk/lib/Frontend/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CacheTokens.cpp?rev=251828&r1=251827&r2=251828&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CacheTokens.cpp (original)
+++ cfe/trunk/lib/Frontend/CacheTokens.cpp Mon Nov  2 14:47:31 2015
@@ -106,7 +106,7 @@ public:
   }
 
   unsigned getRepresentationLength() const {
-    return Kind == IsNoExist ? 0 : 4 + 4 + 2 + 8 + 8;
+    return Kind == IsNoExist ? 0 : 4 * 8;
   }
 };
 




More information about the cfe-commits mailing list