Skip to content

Commit 876a5e2

Browse files
WeiN76LQh0cyn
authored andcommitted
[SharedCache] Only setup undo actions and bulk modify in SharedCache::FindSymbolAtAddrAndApplyToAddr if a symbol is found
1 parent 28aef35 commit 876a5e2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

view/sharedcache/core/SharedCache.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,13 +2974,14 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr(
29742974
}
29752975
});
29762976

2977-
std::vector<std::pair<uint64_t, std::pair<BNSymbolType, std::string>>> exportMapping;
2978-
auto typeLib = TypeLibraryForImage(header->installName);
2979-
id = m_dscView->BeginUndoActions();
2980-
m_dscView->BeginBulkModifySymbols();
29812977
if (auto it = exportList.find(symbolLocation); it != exportList.end())
29822978
{
2983-
if (auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation))
2979+
auto typeLib = TypeLibraryForImage(header->installName);
2980+
id = m_dscView->BeginUndoActions();
2981+
m_dscView->BeginBulkModifySymbols();
2982+
2983+
auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation);
2984+
if (func)
29842985
{
29852986
m_dscView->DefineUserSymbol(
29862987
new Symbol(FunctionSymbol, prefix + it->second->GetFullName(), targetLocation));
@@ -3000,13 +3001,13 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr(
30003001
}
30013002
if (triggerReanalysis)
30023003
{
3003-
auto func = m_dscView->GetAnalysisFunction(m_dscView->GetDefaultPlatform(), targetLocation);
30043004
if (func)
30053005
func->Reanalyze();
30063006
}
3007+
3008+
m_dscView->EndBulkModifySymbols();
3009+
m_dscView->ForgetUndoActions(id);
30073010
}
3008-
m_dscView->EndBulkModifySymbols();
3009-
m_dscView->ForgetUndoActions(id);
30103011
}
30113012
}
30123013

0 commit comments

Comments
 (0)