[lldb] Fix Scripted ProcessLaunchInfo Argument nullptr deref

This patch adds a new `StructuredData::Dictionary` constructor that
takes a `StructuredData::ObjectSP` as an argument. This is used to pass
the opaque_ptr from the `SBStructuredData` used to initialize a
ScriptedProecss, to the `ProcessLaunchInfo` class.

This also updates `SBLaunchInfo::SetScriptedProcessDictionary` to
reflect the formentionned changes which solves the nullptr deref.

Differential Revision: https://reviews.llvm.org/D112107

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
Med Ismail Bennani
2021-11-10 16:43:19 +00:00
parent 9aea27ac88
commit ad0f7d3d4a
6 changed files with 28 additions and 15 deletions

View File

@@ -106,7 +106,7 @@ ScriptedProcess::ScriptedProcess(
StructuredData::GenericSP object_sp = GetInterface().CreatePluginObject(
m_scripted_process_info.GetClassName().c_str(), exe_ctx,
m_scripted_process_info.GetDictionarySP());
m_scripted_process_info.GetArgsSP());
if (!object_sp || !object_sp->IsValid()) {
error.SetErrorStringWithFormat("ScriptedProcess::%s () - ERROR: %s",