Skip to content

Commit 02fd0ac

Browse files
xusheng6claude
andcommitted
[emulator] Return a reference, not a raw pointer, from LLILEmulator::GetView
The view member is reference counted; returning a raw BinaryView* from a public getter invites use-after-free if the emulator outlives the caller's assumptions. Return Ref<BinaryView> so callers hold their own reference. Addresses emesare review comment on PR #8314. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 067252a commit 02fd0ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/emulator/core/llilemulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,6 @@ namespace BinaryNinjaEmulator
201201
// State serialization
202202
std::string SaveState() const;
203203
bool LoadState(const std::string& json, BinaryNinja::BinaryView* view);
204-
BinaryNinja::BinaryView* GetView() const { return m_view; }
204+
BinaryNinja::Ref<BinaryNinja::BinaryView> GetView() const { return m_view; }
205205
};
206206
}

0 commit comments

Comments
 (0)