r197762 - Correctly compute the size in bytes of PreambleFileHash.MD5
Dmitri Gribenko
gribozavr at gmail.com
Thu Dec 19 17:07:30 PST 2013
Author: gribozavr
Date: Thu Dec 19 19:07:30 2013
New Revision: 197762
URL: http://llvm.org/viewvc/llvm-project?rev=197762&view=rev
Log:
Correctly compute the size in bytes of PreambleFileHash.MD5
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=197762&r1=197761&r2=197762&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Dec 19 19:07:30 2013
@@ -1364,7 +1364,7 @@ ASTUnit::PreambleFileHash::createForFile
PreambleFileHash Result;
Result.Size = Size;
Result.ModTime = ModTime;
- memset(Result.MD5, 0, sizeof(Result.MD5[0]) * sizeof(Result.MD5));
+ memset(Result.MD5, 0, sizeof(Result.MD5));
return Result;
}
@@ -1385,7 +1385,7 @@ namespace clang {
bool operator==(const ASTUnit::PreambleFileHash &LHS,
const ASTUnit::PreambleFileHash &RHS) {
return LHS.Size == RHS.Size && LHS.ModTime == RHS.ModTime &&
- memcmp(LHS.MD5, RHS.MD5, sizeof(LHS.MD5[0]) * sizeof(LHS.MD5)) == 0;
+ memcmp(LHS.MD5, RHS.MD5, sizeof(LHS.MD5)) == 0;
}
} // namespace clang
More information about the cfe-commits
mailing list