Skip to content

Commit

Permalink
Fixed a copy-paste bug in findAllStoresForLoad function while finding…
Browse files Browse the repository at this point in the history
… matching stores for loads with partial overlap
  • Loading branch information
DrSahoo committed Aug 1, 2018
1 parent f3d64a3 commit 86f3b8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Giri/TraceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,18 +899,22 @@ void TraceFile::findAllStoresForLoad(DynValue &DV,
addToWorklist(NDV, Sources, DV);

Entry &store_entry = trace[store_index];
// Find stores corresponding to any non-overlapping part of load
// before the start of matched store
if (load_entry.address < store_entry.address) {
Entry new_entry;
new_entry.address = load_entry.address;
new_entry.length = store_entry.address - load_entry.address;
findAllStoresForLoad(DV, Sources, store_index - 1, new_entry);
}

// Find stores corresponding to any non-overlapping part of load
// before the start of matched store
unsigned long store_end = store_entry.address + store_entry.length;
unsigned long load_end = load_entry.address + load_entry.length;
if (store_end < load_end) {
Entry new_entry;
new_entry.address = load_entry.address;
new_entry.address = store_end;
new_entry.length = load_end - store_end;
findAllStoresForLoad(DV, Sources, store_index - 1, new_entry);
}
Expand Down

0 comments on commit 86f3b8a

Please sign in to comment.