pcsx2 debugger: don't use erased iterator

CID 146848 (#1 of 1): Using invalid iterator (INVALIDATE_ITERATOR)
8. use_iterator: Using invalid iterator existing.

Directly edit the value through the iterator.
This commit is contained in:
Gregory Hainaut 2015-10-13 00:17:28 +02:00
parent 7c69958c92
commit 4d680b73dc
1 changed files with 6 additions and 15 deletions

View File

@ -341,11 +341,8 @@ void SymbolMap::AddFunction(const char* name, u32 address, u32 size, int moduleI
if (existing != functions.end()) {
existing->second.size = size;
if (existing->second.module != moduleIndex) {
FunctionEntry func = existing->second;
func.start = relAddress;
func.module = moduleIndex;
functions.erase(existing);
functions[symbolKey] = func;
existing->second.start = relAddress;
existing->second.module = moduleIndex;
}
// Refresh the active item if it exists.
@ -540,11 +537,8 @@ void SymbolMap::AddLabel(const char* name, u32 address, int moduleIndex) {
// We leave an existing label alone, rather than overwriting.
// But we'll still upgrade it to the correct module / relative address.
if (existing->second.module != moduleIndex) {
LabelEntry label = existing->second;
label.addr = relAddress;
label.module = moduleIndex;
labels.erase(existing);
labels[symbolKey] = label;
existing->second.addr = relAddress;
existing->second.module = moduleIndex;
// Refresh the active item if it exists.
auto active = activeLabels.find(address);
@ -646,11 +640,8 @@ void SymbolMap::AddData(u32 address, u32 size, DataType type, int moduleIndex) {
existing->second.size = size;
existing->second.type = type;
if (existing->second.module != moduleIndex) {
DataEntry entry = existing->second;
entry.module = moduleIndex;
entry.start = relAddress;
data.erase(existing);
data[symbolKey] = entry;
existing->second.module = moduleIndex;
existing->second.start = relAddress;
}
// Refresh the active item if it exists.