mirror of
https://github.com/rizinorg/cutter.git
synced 2024-11-23 21:09:42 +00:00
Fix disassembly scroll history. (#3183)
Avoid calling `erase()` when `topOffsetHistoryPos + 1 >= `topOffsetHistory.size()`. closes #3181
This commit is contained in:
parent
3e402c225e
commit
f1a421c9f6
@ -665,8 +665,10 @@ void DisassemblyWidget::on_seekChanged(RVA offset, CutterCore::SeekHistoryType t
|
||||
{
|
||||
if (type == CutterCore::SeekHistoryType::New) {
|
||||
// Erase previous history past this point.
|
||||
topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1,
|
||||
topOffsetHistory.end());
|
||||
if (topOffsetHistory.size() > topOffsetHistoryPos + 1) {
|
||||
topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1,
|
||||
topOffsetHistory.end());
|
||||
}
|
||||
topOffsetHistory.push_back(offset);
|
||||
topOffsetHistoryPos = topOffsetHistory.size() - 1;
|
||||
} else if (type == CutterCore::SeekHistoryType::Undo) {
|
||||
|
Loading…
Reference in New Issue
Block a user