Skip to content

Commit

Permalink
Address feedbacks from Alex
Browse files Browse the repository at this point in the history
  • Loading branch information
kyulee-com committed Jul 11, 2024
1 parent d7dc2a1 commit 13afd88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGenData/CodeGenData.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CGDataError : public ErrorInfo<CGDataError> {
/// contain a single CGDataError.
static std::pair<cgdata_error, std::string> take(Error E) {
auto Err = cgdata_error::success;
std::string Msg = "";
std::string Msg;
handleAllErrors(std::move(E), [&Err, &Msg](const CGDataError &IPE) {
assert(Err == cgdata_error::success && "Multiple errors encountered");
Err = IPE.get();
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGenData/CodeGenDataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ CodeGenDataReader::create(std::unique_ptr<MemoryBuffer> Buffer) {

bool IndexedCodeGenDataReader::hasFormat(const MemoryBuffer &DataBuffer) {
using namespace support;
if (DataBuffer.getBufferSize() < 8)
if (DataBuffer.getBufferSize() < sizeof(IndexedCGData::Magic))
return false;

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

0 comments on commit 13afd88

Please sign in to comment.