Skip to content

Commit 13afd88

Browse files
committed
Address feedbacks from Alex
1 parent d7dc2a1 commit 13afd88

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/CodeGenData/CodeGenData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CGDataError : public ErrorInfo<CGDataError> {
8181
/// contain a single CGDataError.
8282
static std::pair<cgdata_error, std::string> take(Error E) {
8383
auto Err = cgdata_error::success;
84-
std::string Msg = "";
84+
std::string Msg;
8585
handleAllErrors(std::move(E), [&Err, &Msg](const CGDataError &IPE) {
8686
assert(Err == cgdata_error::success && "Multiple errors encountered");
8787
Err = IPE.get();

llvm/lib/CodeGenData/CodeGenDataReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ CodeGenDataReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
121121

122122
bool IndexedCodeGenDataReader::hasFormat(const MemoryBuffer &DataBuffer) {
123123
using namespace support;
124-
if (DataBuffer.getBufferSize() < 8)
124+
if (DataBuffer.getBufferSize() < sizeof(IndexedCGData::Magic))
125125
return false;
126126

127127
uint64_t Magic = endian::read<uint64_t, llvm::endianness::little, aligned>(

0 commit comments

Comments
 (0)