mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 11:26:11 +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) {
|
if (type == CutterCore::SeekHistoryType::New) {
|
||||||
// Erase previous history past this point.
|
// Erase previous history past this point.
|
||||||
topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1,
|
if (topOffsetHistory.size() > topOffsetHistoryPos + 1) {
|
||||||
topOffsetHistory.end());
|
topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1,
|
||||||
|
topOffsetHistory.end());
|
||||||
|
}
|
||||||
topOffsetHistory.push_back(offset);
|
topOffsetHistory.push_back(offset);
|
||||||
topOffsetHistoryPos = topOffsetHistory.size() - 1;
|
topOffsetHistoryPos = topOffsetHistory.size() - 1;
|
||||||
} else if (type == CutterCore::SeekHistoryType::Undo) {
|
} else if (type == CutterCore::SeekHistoryType::Undo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user