summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.cpp
diff options
context:
space:
mode:
authorWeiN76LQh <WeiN76LQh@github.com>2024-11-26 16:35:55 +0000
committerkat <kat@vector35.com>2025-02-10 10:33:20 -0500
commit876a5e2f8eeea13dd4aed5bbf7abc853727dcc85 (patch)
treec9560616514ca158fe78f10546f0c198feb7fe0a /view/sharedcache/core/SharedCache.cpp
parent28aef35c76c4b6c9215aeb82f974032031154bd1 (diff)
[SharedCache] Only setup undo actions and bulk modify in `SharedCache::FindSymbolAtAddrAndApplyToAddr` if a symbol is found
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
-rw-r--r--view/sharedcache/core/SharedCache.cpp17
1 files changed, 9 insertions, 8 deletions
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<std::pair<uint64_t, std::pair<BNSymbolType, std::string>>> 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);
}
}