diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp index 5c7b9e054403..886add7131da 100644 --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -1295,7 +1295,7 @@ Error IndexedInstrProfReader::readHeader() { // Writer first writes the length of compressed string, and then the actual // content. const char *VTableNamePtr = (const char *)Ptr; - if (VTableNamePtr > (const char *)DataBuffer->getBufferEnd()) + if (VTableNamePtr > DataBuffer->getBufferEnd()) return make_error(instrprof_error::truncated); VTableName = StringRef(VTableNamePtr, CompressedVTableNamesLen);