diff options
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/pc_event.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cpu/pc_event.cc b/src/cpu/pc_event.cc index 9cf63f7d3..2b54ee5fb 100644 --- a/src/cpu/pc_event.cc +++ b/src/cpu/pc_event.cc @@ -56,13 +56,18 @@ PCEventQueue::remove(PCEvent *event) { int removed = 0; range_t range = equal_range(event); - for (iterator i = range.first; i != range.second; ++i) { + iterator i = range.first; + while (i != range.second && + i != pc_map.end()) { if (*i == event) { DPRINTF(PCEvent, "PC based event removed at %#x: %s\n", event->pc(), event->descr()); - pc_map.erase(i); + i = pc_map.erase(i); ++removed; + } else { + i++; } + } return removed > 0; |