bulbazord created this revision. bulbazord added a reviewer: jingham. Herald added a project: All. bulbazord requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
If you pass `nullptr` (or `None` from python) to SBPlatform::SetSDKRoot, LLDB crashes. Let's be more resilient to `nullptr` here. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D152962 Files: lldb/source/API/SBPlatform.cpp Index: lldb/source/API/SBPlatform.cpp =================================================================== --- lldb/source/API/SBPlatform.cpp +++ lldb/source/API/SBPlatform.cpp @@ -488,7 +488,7 @@ void SBPlatform::SetSDKRoot(const char *sysroot) { LLDB_INSTRUMENT_VA(this, sysroot); if (PlatformSP platform_sp = GetSP()) - platform_sp->SetSDKRootDirectory(sysroot); + platform_sp->SetSDKRootDirectory(llvm::StringRef(sysroot).str()); } SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) {
Index: lldb/source/API/SBPlatform.cpp =================================================================== --- lldb/source/API/SBPlatform.cpp +++ lldb/source/API/SBPlatform.cpp @@ -488,7 +488,7 @@ void SBPlatform::SetSDKRoot(const char *sysroot) { LLDB_INSTRUMENT_VA(this, sysroot); if (PlatformSP platform_sp = GetSP()) - platform_sp->SetSDKRootDirectory(sysroot); + platform_sp->SetSDKRootDirectory(llvm::StringRef(sysroot).str()); } SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits