summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-11-28 11:13:08 -0800
committerMark Rowe <mark@vector35.com>2025-12-08 13:21:58 -0800
commit540fca65afaff35343a938b86596b21f2e16b48d (patch)
treef84da14232124ab1829f4051de2794b304355827 /plugins
parentdaede114cfacf4cd68ed0a9f67c829b8b16da961 (diff)
Introduce an RAII type for managing bulk symbol modifications
Fixes https://github.com/Vector35/binaryninja-api/issues/7666. Correctly managing the state of bulk symbol modifications via `BeginBulkModifySymbols` / `EndBulkModifySymbols` is error-prone in the face of exceptions and early returns. Leaking a bulk symbol modification can leave the view in a state where no further changes to symbols will be applied. All users of the C++ API are encouraged to move from `BeginBulkModifySymbols` / `EndBulkModifySymbols` to the new `BulkSymbolModification` class.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rtti/itanium.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/rtti/itanium.cpp b/plugins/rtti/itanium.cpp
index 63f2c563..34fd0f71 100644
--- a/plugins/rtti/itanium.cpp
+++ b/plugins/rtti/itanium.cpp
@@ -760,7 +760,7 @@ void ItaniumRTTIProcessor::ProcessRTTI()
m_logger->LogWarn("Too many failed scans for section %llx... skipping", section->GetStart());
};
- m_view->BeginBulkModifySymbols();
+ BulkSymbolModification bulkSymbolModification(m_view);
// Scan data sections for rtti.
for (const Ref<Section> &section : m_view->GetSections())
{
@@ -782,7 +782,7 @@ void ItaniumRTTIProcessor::ProcessRTTI()
}
}
}
- m_view->EndBulkModifySymbols();
+ bulkSymbolModification.End();
// Go through all classes and recurse into the base classes using the base class name
for (auto &[classAddr, classInfo]: m_classInfo)