From 540fca65afaff35343a938b86596b21f2e16b48d Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Fri, 28 Nov 2025 11:13:08 -0800 Subject: 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. --- view/elf/elfview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/elf/elfview.cpp') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index 0e206032..e473795f 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -1053,7 +1053,7 @@ bool ElfView::Init() m_logger->LogError("ELF relocation table invalid"); } - BeginBulkModifySymbols(); + BulkSymbolModification bulkSymbolModification(this); vector auxSymbolTable; try @@ -1408,7 +1408,7 @@ bool ElfView::Init() delete m_symbolQueue; m_symbolQueue = nullptr; - EndBulkModifySymbols(); + bulkSymbolModification.End(); auto relocHandler = m_arch->GetRelocationHandler("ELF"); if (relocHandler) -- cgit v1.3.1