Skip to content

Commit

Permalink
fix regression in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 23, 2023
1 parent a9ccfb0 commit 36dc0e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ir/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,9 @@ Memory::AliasSet Memory::computeAliasing(const Pointer &ptr, unsigned bytes,
return aliasing;
}

template <typename Fn>
void Memory::access(const Pointer &ptr, unsigned bytes, uint64_t align,
bool write, Fn &fn) {
bool write, const
function<void(MemBlock&, unsigned, bool, expr&&)> &fn) {
auto aliasing = computeAliasing(ptr, bytes, align, write);
unsigned has_local = aliasing.numMayAlias(true);
unsigned has_nonlocal = aliasing.numMayAlias(false);
Expand Down Expand Up @@ -972,12 +972,12 @@ vector<Byte> Memory::load(const Pointer &ptr, unsigned bytes, set<expr> &undef,
expr offset = ptr.getShortOffset();
unsigned off_bits = Pointer::bitsShortOffset();

auto fn = [&](const MemBlock &blk, unsigned bid, bool local, expr &&cond) {
auto fn = [&](MemBlock &blk, unsigned bid, bool local, expr &&cond) {
bool is_poison = (type & blk.type) == DATA_NONE;
for (unsigned i = 0; i < loaded_bytes; ++i) {
unsigned idx = left2right ? i : (loaded_bytes - i - 1);
expr off = offset + expr::mkUInt(idx, off_bits);
loaded[i].add(is_poison ? poison : blk.val.load(off), std::move(cond));
loaded[i].add(is_poison ? poison : blk.val.load(off), cond);
if (!is_poison)
undef.insert(blk.undef.begin(), blk.undef.end());
}
Expand Down
4 changes: 2 additions & 2 deletions ir/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ class Memory {
AliasSet computeAliasing(const Pointer &ptr, unsigned bytes, uint64_t align,
bool write) const;

template <typename Fn>
void access(const Pointer &ptr, unsigned btyes, uint64_t align, bool write,
Fn &fn);
const std::function<void(MemBlock&, unsigned, bool,
smt::expr&&)> &fn);

std::vector<Byte> load(const Pointer &ptr, unsigned bytes,
std::set<smt::expr> &undef, uint64_t align,
Expand Down

0 comments on commit 36dc0e3

Please sign in to comment.