From 4d680b73dcada7f00d976c5eb95f2dfc26b30715 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 13 Oct 2015 00:17:28 +0200 Subject: [PATCH] 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. --- pcsx2/DebugTools/SymbolMap.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pcsx2/DebugTools/SymbolMap.cpp b/pcsx2/DebugTools/SymbolMap.cpp index 2c08b95d63..26f16be569 100644 --- a/pcsx2/DebugTools/SymbolMap.cpp +++ b/pcsx2/DebugTools/SymbolMap.cpp @@ -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.