-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] Fix ubsan violation with plugin loading #126652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Fix ubsan violation with plugin loading #126652
Conversation
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 ```
@llvm/pr-subscribers-lldb Author: Keith Smiley (keith) ChangesThis typedef doesn't match the signature below, specifically the signature takes a
Full diff: https://github.com/llvm/llvm-project/pull/126652.diff 1 Files Affected:
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 4e6b22492a0d1c2..bdb8e538b99f861 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -185,7 +185,7 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() {
llvm::sys::DynamicLibrary dynlib =
llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
if (dynlib.isValid()) {
- typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger);
+ typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger debugger);
lldb::SBDebugger debugger_sb(debugger_sp);
// This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 ```
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 ```
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 ```
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 ```
This typedef doesn't match the signature below, specifically the signature takes a
lldb:SBDebugger
vs this was defined aslldb:SBDebugger&
.