Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mlir/lib/Bytecode/Reader/BytecodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class EncodingReader {
return emitError("expected alignment to be a power-of-two");

auto isUnaligned = [&](const uint8_t *ptr) {
return ((uintptr_t)ptr & (alignment - 1)) != 0;
unsigned offset = ptr - buffer.begin();
return (offset & (alignment - 1)) != 0;
};

// Shift the reader position to the next alignment boundary.
Expand Down Expand Up @@ -1506,7 +1507,7 @@ class mlir::BytecodeReader::Impl {
UseListOrderStorage(bool isIndexPairEncoding,
SmallVector<unsigned, 4> &&indices)
: indices(std::move(indices)),
isIndexPairEncoding(isIndexPairEncoding){};
isIndexPairEncoding(isIndexPairEncoding) {};
/// The vector containing the information required to reorder the
/// use-list of a value.
SmallVector<unsigned, 4> indices;
Expand Down