Skip to content

Commit

Permalink
Merge pull request #96 from OpenXiangShan/fix-iter-erase
Browse files Browse the repository at this point in the history
cpu-o3: Fix invalid iter de-reference when squashing inst
  • Loading branch information
shinezyy authored Oct 27, 2023
2 parents 83e80d3 + 502a64f commit 6a85ffb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpu/o3/rob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ ROB::doSquash(ThreadID tid)

// printf("[ROB] squash seqNum %ld\n", (*squashIt[tid])->seqNum);

auto prevIt = std::prev(squashIt[tid]);
instList[tid].erase(squashIt[tid]);
--numInstsInROB;
--threadEntries[tid];
Expand All @@ -392,7 +393,7 @@ ROB::doSquash(ThreadID tid)
if ((*squashIt[tid]) == (*tail_thread))
robTailUpdate = true;

squashIt[tid]--;
squashIt[tid] = prevIt;
}


Expand Down

0 comments on commit 6a85ffb

Please sign in to comment.