Skip to content

Commit 5bf42d3

Browse files
authored
[lldb] Fix ubsan violation with plugin loading (#126652)
This typedef doesn't match the signature below, specifically the signature takes a `lldb:SBDebugger` vs this was defined as `lldb:SBDebugger&`. ``` lldb/source/API/SBDebugger.cpp:199:13: runtime error: call to function lldb::PluginInitialize(lldb::SBDebugger) through pointer to incorrect function type 'bool (*)(lldb::SBDebugger &)' .../CustomPlugin.cpp:134: note: lldb::PluginInitialize(lldb::SBDebugger) defined here ```
1 parent ab93bd6 commit 5bf42d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/API/SBDebugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() {
185185
llvm::sys::DynamicLibrary dynlib =
186186
llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
187187
if (dynlib.isValid()) {
188-
typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger);
188+
typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger debugger);
189189

190190
lldb::SBDebugger debugger_sb(debugger_sp);
191191
// This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)

0 commit comments

Comments
 (0)