Skip to content

Commit

Permalink
fix #1137: physical pointers can also alias with new constants in tgt
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 9, 2024
1 parent c3fbb0e commit 08285b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ir/pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ Pointer::isDereferenceable(const expr &bytes0, uint64_t align,
bool all_same_size = true;
expr addr = is_phy ? p.getPhysicalAddress() : p.getAddress();

auto add = [&](unsigned limit, bool local) {
for (unsigned i = 0; i != limit; ++i) {
auto add = [&](unsigned start, unsigned limit, bool local) {
for (unsigned i = start; i < limit; ++i) {
// address not observed; can't alias with that
if (local && !m.observed_addrs.mayAlias(true, i))
continue;
Expand All @@ -619,8 +619,10 @@ Pointer::isDereferenceable(const expr &bytes0, uint64_t align,
addrs.add(std::move(this_addr), std::move(cond));
}
};
add(m.numLocals(), true);
add(m.numCurrentNonLocals(), false);
add(0, m.numLocals(), true);
add(0, m.numCurrentNonLocals(), false);
if (!m.getState().isSource())
add(num_nonlocals_src, num_nonlocals, false);

expr bid = *std::move(bids)();
if (!observes_local)
Expand Down

0 comments on commit 08285b3

Please sign in to comment.