From 876a5e2f8eeea13dd4aed5bbf7abc853727dcc85 Mon Sep 17 00:00:00 2001 From: WeiN76LQh Date: Tue, 26 Nov 2024 16:35:55 +0000 Subject: [SharedCache] Only setup undo actions and bulk modify in `SharedCache::FindSymbolAtAddrAndApplyToAddr` if a symbol is found --- view/sharedcache/core/SharedCache.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'view/sharedcache') diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index 61b18223..c7591c3a 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -2974,13 +2974,14 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr( } }); - std::vector>> exportMapping; - auto typeLib = TypeLibraryForImage(header->installName); - id = m_dscView->BeginUndoActions(); - m_dscView->BeginBulkModifySymbols(); if (auto it = exportList.find(symbolLocation); it != exportList.end()) { - if (auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation)) + auto typeLib = TypeLibraryForImage(header->installName); + id = m_dscView->BeginUndoActions(); + m_dscView->BeginBulkModifySymbols(); + + auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation); + if (func) { m_dscView->DefineUserSymbol( new Symbol(FunctionSymbol, prefix + it->second->GetFullName(), targetLocation)); @@ -3000,13 +3001,13 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr( } if (triggerReanalysis) { - auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation); if (func) func->Reanalyze(); } + + m_dscView->EndBulkModifySymbols(); + m_dscView->ForgetUndoActions(id); } - m_dscView->EndBulkModifySymbols(); - m_dscView->ForgetUndoActions(id); } } -- cgit v1.3.1