Skip to content

Commit 623ad8a

Browse files
committed
[lldb] Fix SBPlatform after f4be9ff
If you pass `nullptr` (or `None` from python) to SBPlatform::SetSDKRoot, LLDB crashes. Let's be more resilient to `nullptr` here. Differential Revision: https://reviews.llvm.org/D152962
1 parent 39ab9da commit 623ad8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/API/SBPlatform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ uint32_t SBPlatform::GetOSUpdateVersion() {
488488
void SBPlatform::SetSDKRoot(const char *sysroot) {
489489
LLDB_INSTRUMENT_VA(this, sysroot);
490490
if (PlatformSP platform_sp = GetSP())
491-
platform_sp->SetSDKRootDirectory(sysroot);
491+
platform_sp->SetSDKRootDirectory(llvm::StringRef(sysroot).str());
492492
}
493493

494494
SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) {

0 commit comments

Comments
 (0)