From e97d17db84c0e7fe43a2bb77fa22d9732cd06cbf Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 8 Mar 2023 09:38:15 +0800 Subject: [PATCH] Fix crash on Windows when de-referencing the strings --- core/debuggerstate.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/debuggerstate.cpp b/core/debuggerstate.cpp index e2d26e5e..b2e5d498 100644 --- a/core/debuggerstate.cpp +++ b/core/debuggerstate.cpp @@ -118,11 +118,15 @@ std::vector DebuggerRegisters::GetAllRegisters() { auto it = regHints.find(reg.m_value); if (it != regHints.end()) - reg.m_hint = it->second; + { + reg.m_hint = it->second; + } else - it->second = controller->GetAddressInformation(reg.m_value); - - reg.m_hint = it->second; + { + const std::string hint = controller->GetAddressInformation(reg.m_value); + regHints[reg.m_value] = hint; + reg.m_hint = hint; + } } return result;